[PATCH net-next v2] net: qrtr: ns: Fix error return code in qrtr_ns_init()

Subsystems: networking [general], qualcomm ipc router (qrtr) driver, the rest

STALE1906d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2021-05-19 · open the first message on its own page

[PATCH net-next v2] net: qrtr: ns: Fix error return code in qrtr_ns_init()

From: Wei Yongjun <hidden>
Date: 2021-05-19 15:49:43

Fix to return a negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: c6e08d6251f3 ("net: qrtr: Allocate workqueue before kernel_bind")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
Reviewed-by: Manivannan Sadhasivam <redacted>
---
v1 -> v2: add fixes tag and reviewed-by
---
 net/qrtr/ns.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
index 8d00dfe8139e..1990d496fcfc 100644
--- a/net/qrtr/ns.c
+++ b/net/qrtr/ns.c
@@ -775,8 +775,10 @@ int qrtr_ns_init(void)
 	}
 
 	qrtr_ns.workqueue = alloc_workqueue("qrtr_ns_handler", WQ_UNBOUND, 1);
-	if (!qrtr_ns.workqueue)
+	if (!qrtr_ns.workqueue) {
+		ret = -ENOMEM;
 		goto err_sock;
+	}
 
 	qrtr_ns.sock->sk->sk_data_ready = qrtr_ns_data_ready;
 

Re: [PATCH net-next v2] net: qrtr: ns: Fix error return code in qrtr_ns_init()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-05-19 20:20:18

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 19 May 2021 15:58:52 +0000 you wrote:
Fix to return a negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: c6e08d6251f3 ("net: qrtr: Allocate workqueue before kernel_bind")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
Reviewed-by: Manivannan Sadhasivam <redacted>

[...]
Here is the summary with links:
  - [net-next,v2] net: qrtr: ns: Fix error return code in qrtr_ns_init()
    https://git.kernel.org/netdev/net-next/c/a49e72b3bda7

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