ipv6: Remove some pointless conditionals before kfree_skb()
Remove some pointless conditionals before kfree_skb(). The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E; @@ - if (E) - kfree_skb(E); + kfree_skb(E); // </smpl> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1ce85fe402
commit
800d55f146
|
@ -218,7 +218,6 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
|
|||
if (opt)
|
||||
sock_kfree_s(sk, opt, opt->tot_len);
|
||||
pktopt = xchg(&np->pktoptions, NULL);
|
||||
if (pktopt)
|
||||
kfree_skb(pktopt);
|
||||
|
||||
sk->sk_destruct = inet_sock_destruct;
|
||||
|
|
|
@ -533,7 +533,6 @@ static inline void syn_flood_warning(struct sk_buff *skb)
|
|||
|
||||
static void tcp_v6_reqsk_destructor(struct request_sock *req)
|
||||
{
|
||||
if (inet6_rsk(req)->pktopts)
|
||||
kfree_skb(inet6_rsk(req)->pktopts);
|
||||
}
|
||||
|
||||
|
@ -1611,7 +1610,6 @@ ipv6_pktoptions:
|
|||
}
|
||||
}
|
||||
|
||||
if (opt_skb)
|
||||
kfree_skb(opt_skb);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue