linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Jing Xiangfeng <jingxiangfeng@huawei.com>, m@bues.ch
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ssb: Fix error return in ssb_bus_scan()
Date: Wed, 21 Oct 2020 11:47:06 -0500	[thread overview]
Message-ID: <86de3c58-250e-9da7-1446-2e3bef7ea97a@lwfinger.net> (raw)
In-Reply-To: <20201021073305.4400-1-jingxiangfeng@huawei.com>

On 10/21/20 2:33 AM, Jing Xiangfeng wrote:
> Fix to return error code -EINVAL from the error handling case instead
> of 0.
> 
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
> ---
>   drivers/ssb/scan.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
> index f49ab1aa2149..4161e5d1f276 100644
> --- a/drivers/ssb/scan.c
> +++ b/drivers/ssb/scan.c
> @@ -325,6 +325,7 @@ int ssb_bus_scan(struct ssb_bus *bus,
>   	if (bus->nr_devices > ARRAY_SIZE(bus->devices)) {
>   		pr_err("More than %d ssb cores found (%d)\n",
>   		       SSB_MAX_NR_CORES, bus->nr_devices);
> +		err = -EINVAL;
>   		goto err_unmap;
>   	}
>   	if (bus->bustype == SSB_BUSTYPE_SSB) {
> 

You misread the code. The current version is returning -ENOMEM, not 0 for this 
error. Returning -EINVAL could be regarded as as better value; however, this 
error is not likely to appear and it does not make much difference!

In any case, the commit message is wrong. NACK.

Larry


      reply	other threads:[~2020-10-21 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  7:33 [PATCH] ssb: Fix error return in ssb_bus_scan() Jing Xiangfeng
2020-10-21 16:47 ` Larry Finger [this message]

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=86de3c58-250e-9da7-1446-2e3bef7ea97a@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=jingxiangfeng@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=m@bues.ch \
    /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).