diff mbox series

[-next] mctp: remove unnecessary check before calling kfree_skb()

Message ID 20211130031243.768823-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204
Delegated to: Netdev Maintainers
Headers show
Series [-next] mctp: remove unnecessary check before calling kfree_skb() | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 15 this patch: 15
netdev/cc_maintainers warning 1 maintainers not CCed: matt@codeconstruct.com.au
netdev/build_clang success Errors and warnings before: 20 this patch: 20
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 19 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Yang Yingliang Nov. 30, 2021, 3:12 a.m. UTC
The skb will be checked inside kfree_skb(), so remove the
outside check.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/mctp/af_mctp.c | 3 +--
 net/mctp/route.c   | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 1, 2021, 2:20 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 30 Nov 2021 11:12:43 +0800 you wrote:
> The skb will be checked inside kfree_skb(), so remove the
> outside check.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  net/mctp/af_mctp.c | 3 +--
>  net/mctp/route.c   | 4 +---
>  2 files changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
  - [-next] mctp: remove unnecessary check before calling kfree_skb()
    https://git.kernel.org/netdev/net-next/c/5cfe53cfeb1c

You are awesome, thank you!
diff mbox series

Patch

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 46c44823edb7..8d759b48f747 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