aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/sctp/sctp.h1
-rw-r--r--include/net/sock.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 9f80a7668289..d16a304cbed4 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -448,6 +448,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
448{ 448{
449 struct sctp_ulpevent *event = sctp_skb2event(skb); 449 struct sctp_ulpevent *event = sctp_skb2event(skb);
450 450
451 skb_orphan(skb);
451 skb->sk = sk; 452 skb->sk = sk;
452 skb->destructor = sctp_sock_rfree; 453 skb->destructor = sctp_sock_rfree;
453 atomic_add(event->rmem_len, &sk->sk_rmem_alloc); 454 atomic_add(event->rmem_len, &sk->sk_rmem_alloc);
diff --git a/include/net/sock.h b/include/net/sock.h
index 570c7a12b54e..7f5c41cc45a9 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1250,6 +1250,7 @@ static inline int sk_has_allocations(const struct sock *sk)
1250 1250
1251static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) 1251static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
1252{ 1252{
1253 skb_orphan(skb);
1253 skb->sk = sk; 1254 skb->sk = sk;
1254 skb->destructor = sock_wfree; 1255 skb->destructor = sock_wfree;
1255 /* 1256 /*
@@ -1262,6 +1263,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
1262 1263
1263static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) 1264static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
1264{ 1265{
1266 skb_orphan(skb);
1265 skb->sk = sk; 1267 skb->sk = sk;
1266 skb->destructor = sock_rfree; 1268 skb->destructor = sock_rfree;
1267 atomic_add(skb->truesize, &sk->sk_rmem_alloc); 1269 atomic_add(skb->truesize, &sk->sk_rmem_alloc);