Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c34a7612 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: skb_orphan() changes



It is illegal to set skb->sk without corresponding destructor.

Its therefore safe for skb_orphan() to not clear skb->sk if
skb->destructor is not set.

Also avoid clearing skb->destructor if already NULL.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f2f872f9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1805,11 +1805,12 @@ static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
 */
static inline void skb_orphan(struct sk_buff *skb)
{
	if (skb->destructor)
	if (skb->destructor) {
		skb->destructor(skb);
		skb->destructor = NULL;
		skb->sk		= NULL;
	}
}

/**
 *	skb_orphan_frags - orphan the frags contained in a buffer