tcp: Fix for race due to temporary drop of the socket lock in skb_splice_bits.
[linux-2.6-microblaze.git] / net / core / skbuff.c
index 5c459f2..1e556d3 100644 (file)
@@ -1445,6 +1445,7 @@ done:
 
        if (spd.nr_pages) {
                int ret;
+               struct sock *sk = __skb->sk;
 
                /*
                 * Drop the socket lock, otherwise we have reverse
@@ -1455,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;
        }