x86/platform/uv: Fix an error code in uv_hubs_init()

Return -ENOMEM on allocation failure instead of returning random stack
memory contents.

Fixes: 4fc2cf1f2d ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lkml.kernel.org/r/X8eoN/jMAJb3H3iv@mwanda
This commit is contained in:
Dan Carpenter 2020-12-02 17:44:07 +03:00 committed by Borislav Petkov
parent 6043082c96
commit 18d047bd89
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}