summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/net/sock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 9bc2c830b5a4..cda38015fcae 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1223,6 +1223,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from,
static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
{
+ skb_orphan(skb);
sock_hold(sk);
skb->sk = sk;
skb->destructor = sock_wfree;
@@ -1232,7 +1233,6 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
- skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_rfree;
atomic_add(skb->truesize, &sk->sk_rmem_alloc);