mctp: remove unnecessary check before calling kfree_skb()
The skb will be checked inside kfree_skb(), so remove the outside check. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20211130031243.768823-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
196073f9c4
commit
5cfe53cfeb
@ -405,8 +405,7 @@ static void mctp_sk_unhash(struct sock *sk)
|
||||
trace_mctp_key_release(key, MCTP_TRACE_KEY_CLOSED);
|
||||
|
||||
spin_lock(&key->lock);
|
||||
if (key->reasm_head)
|
||||
kfree_skb(key->reasm_head);
|
||||
kfree_skb(key->reasm_head);
|
||||
key->reasm_head = NULL;
|
||||
key->reasm_dead = true;
|
||||
key->valid = false;
|
||||
|
@ -231,9 +231,7 @@ static void __mctp_key_unlock_drop(struct mctp_sk_key *key, struct net *net,
|
||||
/* and one for the local reference */
|
||||
mctp_key_unref(key);
|
||||
|
||||
if (skb)
|
||||
kfree_skb(skb);
|
||||
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MCTP_FLOWS
|
||||
|
Loading…
x
Reference in New Issue
Block a user