Skip to contentSkip to conversation

net: hsr: remove redundant null check

PATCH Applied Wang Hai 2 participants 2 messages Jul 18, 2020 – Jul 21, 2020

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 net: hsr: remove redundant null check

Because kfree_skb already checked NULL skb parameter, so the additional checks are unnecessary, just remove them.

---
 net/hsr/hsr_forward.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/hsr/hsr_forward.c +2 -4
index ed13760463de..92c8ad75200b 100644
@@ -367,10 +367,8 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port)
 		port->dev->stats.tx_bytes += skb->len;
 	}
 
-	if (frame.skb_hsr)
-		kfree_skb(frame.skb_hsr);
-	if (frame.skb_std)
-		kfree_skb(frame.skb_std);
+	kfree_skb(frame.skb_hsr);
+	kfree_skb(frame.skb_std);
 	return;
 
 out_drop:
Signature · 1 line
2.17.1