]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
net: hsr: remove redundant null check
authorWang Hai <wanghai38@huawei.com>
Sat, 18 Jul 2020 12:53:38 +0000 (20:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 01:33:32 +0000 (18:33 -0700)
Because kfree_skb already checked NULL skb parameter,
so the additional checks are unnecessary, just remove them.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/hsr/hsr_forward.c

index ed13760463decffabaad9144f1117dc6b7cb46c2..92c8ad75200bcf44408164318d41682dc5d1eaba 100644 (file)
@@ -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: