* [PATCH] net: hsr: remove an redundant null check before kfree_skb @ 2019-09-04 3:09 zhong jiang 2019-09-04 11:55 ` net: hsr: remove a " Markus Elfring 0 siblings, 1 reply; 3+ messages in thread From: zhong jiang @ 2019-09-04 3:09 UTC (permalink / raw) To: davem, arvid.brodin; +Cc: zhongjiang, netdev, linux-kernel kfree_skb has taken the null pointer into account. Hence just remove the null check before kfree_skb. Signed-off-by: zhong jiang <zhongjiang@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 ddd9605..0c9e5b0 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: -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: net: hsr: remove a redundant null check before kfree_skb 2019-09-04 3:09 [PATCH] net: hsr: remove an redundant null check before kfree_skb zhong jiang @ 2019-09-04 11:55 ` Markus Elfring 2019-09-04 15:21 ` zhong jiang 0 siblings, 1 reply; 3+ messages in thread From: Markus Elfring @ 2019-09-04 11:55 UTC (permalink / raw) To: zhong jiang, Arvid Brodin, David S. Miller, netdev Cc: linux-kernel, kernel-janitors > kfree_skb has taken the null pointer into account. I suggest to take another look also at information around a similar update suggestion. net-hsr: Delete unnecessary checks before the function call "kfree_skb" https://lkml.org/lkml/2015/11/14/120 https://lore.kernel.org/patchwork/patch/617878/ https://lore.kernel.org/r/5647A77E.6040501@users.sourceforge.net/ https://lkml.org/lkml/2015/11/24/433 https://lore.kernel.org/r/56546951.9080101@alten.se/ Regards, Markus ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: net: hsr: remove a redundant null check before kfree_skb 2019-09-04 11:55 ` net: hsr: remove a " Markus Elfring @ 2019-09-04 15:21 ` zhong jiang 0 siblings, 0 replies; 3+ messages in thread From: zhong jiang @ 2019-09-04 15:21 UTC (permalink / raw) To: Markus Elfring Cc: Arvid Brodin, David S. Miller, netdev, linux-kernel, kernel-janitors On 2019/9/4 19:55, Markus Elfring wrote: >> kfree_skb has taken the null pointer into account. > I suggest to take another look also at information around > a similar update suggestion. > > net-hsr: Delete unnecessary checks before the function call "kfree_skb" > https://lkml.org/lkml/2015/11/14/120 > https://lore.kernel.org/patchwork/patch/617878/ > https://lore.kernel.org/r/5647A77E.6040501@users.sourceforge.net/ > > https://lkml.org/lkml/2015/11/24/433 > https://lore.kernel.org/r/56546951.9080101@alten.se/ Thanks you for explaination. I miss the similar patch before sending it. Sincerely, zhong jiang > Regards, > Markus > > . > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-04 15:21 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-09-04 3:09 [PATCH] net: hsr: remove an redundant null check before kfree_skb zhong jiang 2019-09-04 11:55 ` net: hsr: remove a " Markus Elfring 2019-09-04 15:21 ` zhong jiang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).