summaryrefslogtreecommitdiffstats
path: root/net/mctp/af_mctp.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-11-30 04:12:43 +0100
committerJakub Kicinski <kuba@kernel.org>2021-12-01 03:09:23 +0100
commit5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204 (patch)
treeaa8165bfe31506004ee07e59ebb739149b810ac1 /net/mctp/af_mctp.c
parentnet: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc (diff)
downloadlinux-5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204.tar.xz
linux-5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204.zip
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>
Diffstat (limited to 'net/mctp/af_mctp.c')
-rw-r--r--net/mctp/af_mctp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index 871cf6266125..c921de63b494 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -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;