Commit 768db390 authored by David Miller's avatar David Miller Committed by Greg Kroah-Hartman
Browse files

net: Fix thinko in backport of skb destructor fix.

As noticed by Oliver Hartkopp, the backport of the
'net: Partially allow skb destructors to be used on receive path'
(2.6.30.y commit: 172570a2,
 upstream commit: d55d87fd

)
was buggy.

It should have added an skb_orphan() call to both skb_set_owner_w()
and skb_set_owner_r().  Instead it added two calls to skb_set_owner_r().

This fixes it up.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b260d762
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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;
......@@ -1231,7 +1232,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment