[PATCH 4.19 130/421] ssb: Fix error return code in ssb_bus_scan()

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-07-19 16:10:51
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-07-19
From: Zhen Lei <redacted>

[ Upstream commit 77a0989baa427dbd242c5784d05a53ca3d197d43 ]

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

Fixes: 61e115a56d1a ("[SSB]: add Sonics Silicon Backplane bus support")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Zhen Lei <redacted>
Acked-by: Michael Büsch <m@bues.ch>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/20210515072949.7151-1-thunder.leizhen@huawei.com (local)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ssb/scan.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index 6ceee98ed6ff..5c7e61cafd19 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.30.2


Thread (423 messages) 423 messages, 2 authors, last reply 2021-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help