* [PATCH] ssb: Fix error return in ssb_bus_scan()
@ 2020-10-21 7:33 Jing Xiangfeng
2020-10-21 16:47 ` Larry Finger
0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2020-10-21 7:33 UTC (permalink / raw)
To: m; +Cc: linux-wireless, linux-kernel, jingxiangfeng
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) {
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ssb: Fix error return in ssb_bus_scan()
2020-10-21 7:33 [PATCH] ssb: Fix error return in ssb_bus_scan() Jing Xiangfeng
@ 2020-10-21 16:47 ` Larry Finger
0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2020-10-21 16:47 UTC (permalink / raw)
To: Jing Xiangfeng, m; +Cc: linux-wireless, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-21 16:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 7:33 [PATCH] ssb: Fix error return in ssb_bus_scan() Jing Xiangfeng
2020-10-21 16:47 ` Larry Finger
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).