Commit 18d047bd authored by Dan Carpenter's avatar Dan Carpenter Committed by Borislav Petkov

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

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

Fixes: 4fc2cf1f ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarJustin Ernst <justin.ernst@hpe.com>
Link: https://lkml.kernel.org/r/X8eoN/jMAJb3H3iv@mwanda
parent 6043082c
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment