All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] net: hsr: remove redundant null check
@ 2020-07-18 12:53 Wang Hai
  2020-07-21  1:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Hai @ 2020-07-18 12:53 UTC (permalink / raw
  To: davem, kuba, ap420073; +Cc: netdev, linux-kernel

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>
---
 net/hsr/hsr_forward.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index ed13760463de..92c8ad75200b 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -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:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] net: hsr: remove redundant null check
  2020-07-18 12:53 [PATCH -next] net: hsr: remove redundant null check Wang Hai
@ 2020-07-21  1:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-21  1:33 UTC (permalink / raw
  To: wanghai38; +Cc: kuba, ap420073, netdev, linux-kernel

From: Wang Hai <wanghai38@huawei.com>
Date: Sat, 18 Jul 2020 20:53:38 +0800

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-21  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-18 12:53 [PATCH -next] net: hsr: remove redundant null check Wang Hai
2020-07-21  1:33 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.