]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/skbuff.c
ia64: convert to generic helpers for IPI function calls
[linux-2.6-omap-h63xx.git] / net / core / skbuff.c
index 4fe605fa6f8a27dd2c346bedcb78caa09fdf8e81..1e556d31211742d41acb39cbc2c1cd8460e2d3b0 100644 (file)
@@ -200,7 +200,9 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
                goto nodata;
 
        /*
-        * See comment in sk_buff definition, just before the 'tail' member
+        * Only clear those fields we need to clear, not those that we will
+        * actually initialise below. Hence, don't put any more fields after
+        * the tail pointer in struct sk_buff!
         */
        memset(skb, 0, offsetof(struct sk_buff, tail));
        skb->truesize = size + sizeof(struct sk_buff);
@@ -1443,6 +1445,7 @@ done:
 
        if (spd.nr_pages) {
                int ret;
+               struct sock *sk = __skb->sk;
 
                /*
                 * Drop the socket lock, otherwise we have reverse
@@ -1453,9 +1456,9 @@ done:
                 * we call into ->sendpage() with the i_mutex lock held
                 * and networking will grab the socket lock.
                 */
-               release_sock(__skb->sk);
+               release_sock(sk);
                ret = splice_to_pipe(pipe, &spd);
-               lock_sock(__skb->sk);
+               lock_sock(sk);
                return ret;
        }