summaryrefslogtreecommitdiff
path: root/net/mctp
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-11-30 06:12:43 +0300
committerJoel Stanley <joel@jms.id.au>2022-03-18 03:37:55 +0300
commitd44e312a48091937d8890bce13080fb80b34b9d8 (patch)
treebf06d37f9608aa752ead9da8291f0d94b09dd57d /net/mctp
parent9c3d829044493f7c33ed10089c692ffd2cf95029 (diff)
downloadlinux-d44e312a48091937d8890bce13080fb80b34b9d8.tar.xz
mctp: remove unnecessary check before calling kfree_skb()
The skb will be checked inside kfree_skb(), so remove the outside check. OpenBMC-Staging-Count: 1 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> (cherry picked from commit 5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204) Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'net/mctp')
-rw-r--r--net/mctp/af_mctp.c3
-rw-r--r--net/mctp/route.c4
2 files changed, 2 insertions, 5 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;
diff --git a/net/mctp/route.c b/net/mctp/route.c
index cdf09c2a7007..bd18a6625e5f 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -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