net: hsr: remove redundant null check
Subsystems (3)
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.
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wang Hai <[email protected]>
--- net/hsr/hsr_forward.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/hsr/hsr_forward.c +2 -4
@@ -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
From: Wang Hai <[email protected]>
Date: Sat, 18 Jul 2020 20:53:38 +0800
Quoted 5 lines
Because
kfree_skbalready checked NULL skb parameter, so the additional checks are unnecessary, just remove them.Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>
Applied.