Skip to content

Commit

Permalink
net: hsr: remove redundant null check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Hai authored and David S. Miller committed Jul 21, 2020
1 parent 405e30e commit 2b96692
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/hsr/hsr_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b96692

Please sign in to comment.