Skip to content

Commit 2b96692

Browse files
Wang Haidavem330
authored andcommitted
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 <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 405e30e commit 2b96692

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎net/hsr/hsr_forward.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,8 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port)
367367
port->dev->stats.tx_bytes += skb->len;
368368
}
369369

370-
if (frame.skb_hsr)
371-
kfree_skb(frame.skb_hsr);
372-
if (frame.skb_std)
373-
kfree_skb(frame.skb_std);
370+
kfree_skb(frame.skb_hsr);
371+
kfree_skb(frame.skb_std);
374372
return;
375373

376374
out_drop:

0 commit comments

Comments
 (0)