2021-11-02 12:58:45

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH net-next] amt: fix error return code in amt_init()

Return error code when alloc_workqueue()
fails in amt_init().

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/net/amt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 60a7053a9cf7..d8c9ed9f8a81 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3259,8 +3259,10 @@ static int __init amt_init(void)
goto unregister_notifier;

amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1);
- if (!amt_wq)
+ if (!amt_wq) {
+ err = -ENOMEM;
goto rtnl_unregister;
+ }

spin_lock_init(&source_gc_lock);
spin_lock_bh(&source_gc_lock);
--
2.25.1


2021-11-02 14:14:44

by Taehee Yoo

[permalink] [raw]
Subject: Re: [PATCH net-next] amt: fix error return code in amt_init()

Hi Yang,

On 11/2/21 10:03 PM, Yang Yingliang wrote:
> Return error code when alloc_workqueue()
> fails in amt_init().
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Yang Yingliang <[email protected]>
> ---
> drivers/net/amt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 60a7053a9cf7..d8c9ed9f8a81 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
> @@ -3259,8 +3259,10 @@ static int __init amt_init(void)
> goto unregister_notifier;
>
> amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1);
> - if (!amt_wq)
> + if (!amt_wq) {
> + err = -ENOMEM;
> goto rtnl_unregister;
> + }
>
> spin_lock_init(&source_gc_lock);
> spin_lock_bh(&source_gc_lock);
>

Reviewed-by: Taehee Yoo <[email protected]>

2021-11-03 02:32:44

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next] amt: fix error return code in amt_init()

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

On Tue, 2 Nov 2021 21:03:53 +0800 you wrote:
> Return error code when alloc_workqueue()
> fails in amt_init().
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Yang Yingliang <[email protected]>
> ---
> drivers/net/amt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Here is the summary with links:
- [net-next] amt: fix error return code in amt_init()
https://git.kernel.org/netdev/net/c/db2434343b2c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html