Skip to contentSkip to conversation

s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb”

PATCH Applied Julian Wiedmann 2 participants 2 messages Sep 15, 2019 – Sep 16, 2019

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

PATCH 1/1 s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb”

From: Markus Elfring <[email protected]>

The dev_kfree_skb() function performs also input parameter validation. Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.

---
 drivers/s390/net/ctcm_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/s390/net/ctcm_main.c +2 -4
index 2117870ed855..437a6d822105 100644
@@ -1072,10 +1072,8 @@ static void ctcm_free_netdevice(struct net_device *dev)
 		if (grp) {
 			if (grp->fsm)
 				kfree_fsm(grp->fsm);
-			if (grp->xid_skb)
-				dev_kfree_skb(grp->xid_skb);
-			if (grp->rcvd_xid_skb)
-				dev_kfree_skb(grp->rcvd_xid_skb);
+			dev_kfree_skb(grp->xid_skb);
+			dev_kfree_skb(grp->rcvd_xid_skb);
 			tasklet_kill(&grp->mpc_tasklet2);
 			kfree(grp);
 			priv->mpcg = NULL;
Signature · 1 line
2.17.1