mirror of https://gitee.com/openkylin/linux.git
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:
parent
6043082c96
commit
18d047bd89
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue