* [PATCH -next] amt: remove unneccessary skb pointer check
@ 2022-08-18 9:31 Yang Yingliang
2022-08-19 13:12 ` Taehee Yoo
2022-08-20 0:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-08-18 9:31 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: ap420073, davem
The skb pointer will be checked in kfree_skb(), so remove the outside check.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/net/amt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 9a247eb7679c..2d20be6ffb7e 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work)
amt_event_send_request(amt);
break;
default:
- if (skb)
- kfree_skb(skb);
+ kfree_skb(skb);
break;
}
}
@@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev)
cancel_work_sync(&amt->event_wq);
for (i = 0; i < AMT_MAX_EVENTS; i++) {
skb = amt->events[i].skb;
- if (skb)
- kfree_skb(skb);
+ kfree_skb(skb);
amt->events[i].event = AMT_EVENT_NONE;
amt->events[i].skb = NULL;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] amt: remove unneccessary skb pointer check
2022-08-18 9:31 [PATCH -next] amt: remove unneccessary skb pointer check Yang Yingliang
@ 2022-08-19 13:12 ` Taehee Yoo
2022-08-20 0:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Taehee Yoo @ 2022-08-19 13:12 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, netdev; +Cc: davem
Hi Yang,
Thanks for this work!
On 8/18/22 18:31, Yang Yingliang wrote:
> The skb pointer will be checked in kfree_skb(), so remove the outside check.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Taehee Yoo <ap420073@gmail.com>
> ---
> drivers/net/amt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 9a247eb7679c..2d20be6ffb7e 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
> @@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work)
> amt_event_send_request(amt);
> break;
> default:
> - if (skb)
> - kfree_skb(skb);
> + kfree_skb(skb);
> break;
> }
> }
> @@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev)
> cancel_work_sync(&amt->event_wq);
> for (i = 0; i < AMT_MAX_EVENTS; i++) {
> skb = amt->events[i].skb;
> - if (skb)
> - kfree_skb(skb);
> + kfree_skb(skb);
> amt->events[i].event = AMT_EVENT_NONE;
> amt->events[i].skb = NULL;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] amt: remove unneccessary skb pointer check
2022-08-18 9:31 [PATCH -next] amt: remove unneccessary skb pointer check Yang Yingliang
2022-08-19 13:12 ` Taehee Yoo
@ 2022-08-20 0:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-20 0:00 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, netdev, ap420073, davem
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 18 Aug 2022 17:31:14 +0800 you wrote:
> The skb pointer will be checked in kfree_skb(), so remove the outside check.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/net/amt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Here is the summary with links:
- [-next] amt: remove unneccessary skb pointer check
https://git.kernel.org/netdev/net-next/c/6745bc9b0351
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-20 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 9:31 [PATCH -next] amt: remove unneccessary skb pointer check Yang Yingliang
2022-08-19 13:12 ` Taehee Yoo
2022-08-20 0:00 ` patchwork-bot+netdevbpf
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).