From: Manivannan Sadhasivam <mani@kernel.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH net-next] net: qrtr: ns: Fix error return code in qrtr_ns_init()
Date: Wed, 19 May 2021 19:45:01 +0530 [thread overview]
Message-ID: <20210519141501.GA119648@thinkpad> (raw)
In-Reply-To: <20210519141621.3044684-1-weiyongjun1@huawei.com>
On Wed, May 19, 2021 at 02:16:21PM +0000, Wei Yongjun wrote:
> Fix to return a negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thanks,
Mani
> ---
> 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;
>
>
next prev parent reply other threads:[~2021-05-19 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 14:16 [PATCH net-next] net: qrtr: ns: Fix error return code in qrtr_ns_init() Wei Yongjun
2021-05-19 14:15 ` Manivannan Sadhasivam [this message]
2021-05-19 14:18 ` Manivannan Sadhasivam
2021-05-19 15:26 ` weiyongjun (A)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210519141501.GA119648@thinkpad \
--to=mani@kernel.org \
--cc=davem@davemloft.net \
--cc=hulkci@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).