diff options
| author | Eric Dumazet <edumazet@google.com> | 2013-07-30 16:11:15 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 11:00:10 +0200 |
| commit | 593d24328485c0d1e07ae01608f8885c706355d5 (patch) | |
| tree | bcfbed391a432a9872b0274d6d0eb03bee7a5b3d /include/linux | |
| parent | f834058d996291849ff03d690393fbf8e50be60c (diff) | |
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.
Change-Id: I3edddb522d5f0c81e9c09e01946ab2f68f4b68ad
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/skbuff.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 892d9daf3..e36c253e6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1904,10 +1904,11 @@ 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->destructor = NULL; + skb->sk = NULL; + } } /** |
