platform/x86: dell-laptop: fix error return code in dell_init()
authorweiyongjun (A) <weiyongjun1@huawei.com>
Tue, 14 Nov 2017 13:40:13 +0000 (13:40 +0000)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 21 Nov 2017 18:11:44 +0000 (20:11 +0200)
Fix to return error code -ENOMEM from the kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 549b4930f057 ("platform/x86: dell-smbios: Introduce dispatcher for SMM calls")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/dell-laptop.c

index 2d704361f67284304b17a781ea8b45da617211be..bf897b1832b188c24a92f33fdf74b33b25aeac43 100644 (file)
@@ -2074,8 +2074,10 @@ static int __init dell_init(void)
                goto fail_platform_device2;
 
        buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
-       if (!buffer)
+       if (!buffer) {
+               ret = -ENOMEM;
                goto fail_buffer;
+       }
 
 
        ret = dell_setup_rfkill();