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

Subsystems: amt (automatic multicast tunneling), networking drivers, the rest

STALE1745d LANDED

Landed in mainline as db2434343b2c on 2021-11-03.

3 messages, 3 authors, 2021-11-03 · open the first message on its own page

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

From: Yang Yingliang <hidden>
Date: 2021-11-02 12:56:24

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

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <redacted>
---
 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

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

From: Taehee Yoo <ap420073@gmail.com>
Date: 2021-11-02 14:12:31

Hi Yang,

On 11/2/21 10:03 PM, Yang Yingliang wrote:
quoted hunk
Return error code when alloc_workqueue()
fails in amt_init().

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <redacted>
---
  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 <ap420073@gmail.com>

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

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-03 02:30:14

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:

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 <redacted>
Signed-off-by: Yang Yingliang <redacted>
---
 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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help