x86/platform/uv: Fix an error code in uv_hubs_init()
Subsystems (3)
PATCH 1/1 x86/platform/uv: Fix an error code in uv_hubs_init()
Return -ENOMEM on allocation failure instead of returning success.
--- drivers/platform/x86/uv_sysfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/uv_sysfs.c +1 -0
@@ -248,6 +248,7 @@ static int uv_hubs_init(void) uv_hubs[i] =kzalloc (sizeof (*uv_hubs[i]),GFP_KERNEL );if (!uv_hubs[i]) { i--; + ret = -ENOMEM ; goto err_hubs; }
Signature · 1 line
2.29.2
Quoted 1 line · Dan Carpenter
Return
-ENOMEMon allocation failure instead of returning success.
s/success/random stack memory contents/
Signature · 4 lines
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG NürnbergQuoted 4 lines
Return
-ENOMEMon allocation failure instead of returning success.Fixes 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")Signed-off-by Dan Carpenter <[email protected]>
Thank you for taking the time to find this.
(With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)
Quoted 18 lines
--- drivers/platform/x86/uv_sysfs.c | 1 + 1 file changed, 1 insertion(+)drivers/platform/x86/uv_sysfs.c +1
-1@@ -248,6 +248,7 @@ static int uv_hubs_init(void) uv_hubs[i] =kzalloc (sizeof (*uv_hubs[i]),GFP_KERNEL );if (!uv_hubs[i]) { i--; + ret = -ENOMEM ; goto err_hubs; } --2.29.2
Hans de Goede
Acked-byHi,
Quoted 9 lines · Justin
Quoted 4 lines
Return
-ENOMEMon allocation failure instead of returning success.Fixes 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")Signed-off-by Dan Carpenter <[email protected]>Thank you for taking the time to find this.
Reviewed-by Justin Ernst <[email protected]>(With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)
ATM the drivers/platform/x86/uv_sysfs.c only exists in the tip/x86 tree -next branch, so this fix needs to be merged through the tip/x86 tree, here is my ack for merging it that way:
(either with a fixed up commit-msg as suggested by Borislav, or feel free to add it to a fixed v2 of the patch)
Regards,
Hans
Quoted 20 lines
Quoted 19 lines
--- drivers/platform/x86/uv_sysfs.c | 1 + 1 file changed, 1 insertion(+)drivers/platform/x86/uv_sysfs.c +1
-1@@ -248,6 +248,7 @@ static int uv_hubs_init(void) uv_hubs[i] =kzalloc (sizeof (*uv_hubs[i]),GFP_KERNEL );if (!uv_hubs[i]) { i--; + ret = -ENOMEM ; goto err_hubs; } --2.29.2