Skip to content

Commit 5cfe53c

Browse files
Yang Yingliangkuba-moo
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 196073f commit 5cfe53c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

net/mctp/af_mctp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ static void mctp_sk_unhash(struct sock *sk)
405405
trace_mctp_key_release(key, MCTP_TRACE_KEY_CLOSED);
406406

407407
spin_lock(&key->lock);
408-
if (key->reasm_head)
409-
kfree_skb(key->reasm_head);
408+
kfree_skb(key->reasm_head);
410409
key->reasm_head = NULL;
411410
key->reasm_dead = true;
412411
key->valid = false;

net/mctp/route.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ static void __mctp_key_unlock_drop(struct mctp_sk_key *key, struct net *net,
231231
/* and one for the local reference */
232232
mctp_key_unref(key);
233233

234-
if (skb)
235-
kfree_skb(skb);
236-
234+
kfree_skb(skb);
237235
}
238236

239237
#ifdef CONFIG_MCTP_FLOWS

0 commit comments

Comments
 (0)