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>
Signed-off-by: Jesse Chan <jc@linux.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
zhong jiang 2018-09-20 17:37:46 +08:00 committed by azrim
parent eb686bd100
commit 80f86573cb
No known key found for this signature in database
GPG Key ID: 497F8FB059B45D1C

View File

@ -459,12 +459,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);