summaryrefslogtreecommitdiffstats
path: root/net/qrtr
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2021-05-19 17:58:52 +0200
committerDavid S. Miller <davem@davemloft.net>2021-05-19 22:14:35 +0200
commita49e72b3bda73d36664a084e47da9727a31b8095 (patch)
tree3a34e344da957775981f1dfeb5a21d1d90983100 /net/qrtr
parentnet: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe() (diff)
downloadlinux-a49e72b3bda73d36664a084e47da9727a31b8095.tar.xz
linux-a49e72b3bda73d36664a084e47da9727a31b8095.zip
net: qrtr: ns: Fix error return code in qrtr_ns_init()
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 <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr')
-rw-r--r--net/qrtr/ns.c4
1 files changed, 3 insertions, 1 deletions
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;