diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-09-20 17:37:46 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-21 09:04:37 -0700 |
commit | f2a2f2166af8df04cf87127b6c63f1f4c64a8430 (patch) | |
tree | 72edf8b43e279cfb5e7080730ed788d82f9fa126 /net/ipv6/af_inet6.c | |
parent | 673eed0c18341383ee0b5131935185f6f2bd6278 (diff) | |
download | lwn-f2a2f2166af8df04cf87127b6c63f1f4c64a8430.tar.gz lwn-f2a2f2166af8df04cf87127b6c63f1f4c64a8430.zip |
ipv6: remove redundant null pointer check before kfree_skb
kfree_skb has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree_skb.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 77ef8478234f..e9c8cfdf4b4c 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -468,12 +468,10 @@ void inet6_destroy_sock(struct sock *sk) /* Release rx options */ skb = xchg(&np->pktoptions, NULL); - if (skb) - kfree_skb(skb); + kfree_skb(skb); skb = xchg(&np->rxpmtu, NULL); - if (skb) - kfree_skb(skb); + kfree_skb(skb); /* Free flowlabels */ fl6_free_socklist(sk); |