From: Zhen Lei Date: Sat, 15 May 2021 07:29:49 +0000 (+0800) Subject: ssb: Fix error return code in ssb_bus_scan() X-Git-Tag: v4.19.198~291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a05091c9b2ef89c7d8c891dd420bd133fcd29176;p=thirdparty%2Fkernel%2Fstable.git ssb: Fix error return code in ssb_bus_scan() [ 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 Signed-off-by: Zhen Lei Acked-by: Michael Büsch Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210515072949.7151-1-thunder.leizhen@huawei.com Signed-off-by: Sasha Levin --- diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c index 6ceee98ed6ff2..5c7e61cafd195 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) {