x86/platform/uv: Fix an error code in uv_hubs_init()
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): jMAJb3H3iv@mwanda
The following commit has been merged into the x86/platform branch of tip:
Commit-ID: fa4a379ecfa0c735e8979bb732fe5a1705a64052 Gitweb: https://git.kernel.org/tip/fa4a379ecfa0c735e8979bb732fe5a1705a64052 Author: Dan Carpenter <[email protected]> AuthorDate: Wed, 02 Dec 2020 17:44:07 +03:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Wed, 02 Dec 2020 20:51:53 +01:00
x86/platform/uv: Fix an error code in uv_hubs_init()
Return -ENOMEM on allocation failure instead of returning random stack memory contents.
Fixes 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by Dan Carpenter <[email protected]>
Signed-off-by Borislav Petkov <[email protected]>
--- 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; }
The following commit has been merged into the x86/platform branch of tip:
The following commit has been merged into the x86/platform branch of tip:
Commit-ID: 18d047bd89b8c1f9ba3c9b2d2f7309c953b3ce97 Gitweb: https://git.kernel.org/tip/18d047bd89b8c1f9ba3c9b2d2f7309c953b3ce97 Author: Dan Carpenter <[email protected]> AuthorDate: Wed, 02 Dec 2020 17:44:07 +03:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Thu, 03 Dec 2020 08:51:06 +01:00
x86/platform/uv: Fix an error code in uv_hubs_init()
Return -ENOMEM on allocation failure instead of returning random stack memory contents.
Fixes 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by Dan Carpenter <[email protected]>
Signed-off-by Borislav Petkov <[email protected]>
Reviewed-by Justin Ernst <[email protected]>
--- 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; }