Skip to content

Commit

Permalink
net: qrtr: ns: Fix error return code in qrtr_ns_init()
Browse files Browse the repository at this point in the history
[ Upstream commit a49e72b ]

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

Fixes: c6e08d6 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wei Yongjun authored and gregkh committed Jul 14, 2021
1 parent 40b7017 commit 27e9e0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/qrtr/ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,10 @@ void 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;

Expand Down

0 comments on commit 27e9e0c

Please sign in to comment.