ssb: Fix error return in ssb_bus_scan()
PATCH 1/1 ssb: Fix error return in ssb_bus_scan()
Fix to return error code -EINVAL from the error handling case instead of 0.
Signed-off-by Jing Xiangfeng <[email protected]>
--- drivers/ssb/scan.c | 1 + 1 file changed, 1 insertion(+)
drivers/ssb/scan.c +1 -0
@@ -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 ) {
Signature · 1 line
2.17.1
Quoted 14 lines · Jing Xiangfeng
Fix to return error code
-EINVALfrom the error handling case instead of 0.Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/ssb/scan.c | 1 + 1 file changed, 1 insertion(+)drivers/ssb/scan.c +0
-0
drivers/ssb/scan.c int ssb_bus_scan(struct ssb_bus *bus, · line 331
Quoted 7 lines
drivers/ssb/scan.c +1
-0@@ -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