Skip to contentSkip to conversation

mctp: remove unnecessary check before calling kfree_skb()

PATCH Applied Yang Yingliang 2 participants 2 messages Nov 30, 2021 – Dec 1, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mctp: remove unnecessary check before calling kfree_skb()

The skb will be checked inside kfree_skb(), so remove the outside check.

---
 net/mctp/af_mctp.c | 3 +--
 net/mctp/route.c   | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)
net/mctp/af_mctp.c +1 -2
index 871cf6266125..c921de63b494 100644
@@ -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;
net/mctp/route.c +1 -3
index 46c44823edb7..8d759b48f747 100644
@@ -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
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 30 Nov 2021 11:12:43 +0800 you wrote:

The skb will be checked inside kfree_skb(), so remove the outside check.

---
 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html