diff mbox series

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

Message ID 20211102130353.1666999-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit db2434343b2c29817fe1fa63919e9c56218a46e8
Delegated to: Netdev Maintainers
Headers show
Series [net-next] amt: fix error return code in amt_init() | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 35 this patch: 35
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 28 this patch: 28
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Yang Yingliang Nov. 2, 2021, 1:03 p.m. UTC
Return error code when alloc_workqueue()
fails in amt_init().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/amt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Taehee Yoo Nov. 2, 2021, 2:12 p.m. UTC | #1
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 <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   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>
patchwork-bot+netdevbpf@kernel.org Nov. 3, 2021, 2:30 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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 <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  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!
diff mbox series

Patch

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