Commit 5cfe53cf authored by Yang Yingliang's avatar Yang Yingliang Committed by Jakub Kicinski

mctp: remove unnecessary check before calling kfree_skb()

The skb will be checked inside kfree_skb(), so remove the
outside check.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211130031243.768823-1-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 196073f9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment