From: weiyongjun (A) Date: Tue, 14 Nov 2017 13:40:13 +0000 (+0000) Subject: platform/x86: dell-laptop: fix error return code in dell_init() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c6f9288ee460565b94994aaf3261318199c2a674;p=linux.git platform/x86: dell-laptop: fix error return code in dell_init() 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 Acked-by: Mario Limonciello Signed-off-by: Andy Shevchenko --- diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 2d704361f6728..bf897b1832b18 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -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();