diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-12-02 17:44:07 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-12-03 10:51:06 +0300 |
commit | 18d047bd89b8c1f9ba3c9b2d2f7309c953b3ce97 (patch) | |
tree | 2078630763bbb63e1f1d680fe59896bada18284b /drivers/platform/x86/uv_sysfs.c | |
parent | 6043082c96844fa3a047896212e2da0adc1dde81 (diff) | |
download | linux-18d047bd89b8c1f9ba3c9b2d2f7309c953b3ce97.tar.xz |
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 <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
Diffstat (limited to 'drivers/platform/x86/uv_sysfs.c')
-rw-r--r-- | drivers/platform/x86/uv_sysfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index 54c342579f1c..e17ce8c4cdad 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -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; } |