All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] platform/x86: dell-laptop: fix error return code in dell_init()
@ 2017-11-14 13:40 Wei Yongjun
  2017-11-14 14:38 ` Mario.Limonciello
  2017-11-23  9:03 ` Pali Rohár
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2017-11-14 13:40 UTC (permalink / raw)
  To: mjg59, pali.rohar, dvhart, andy, Mario Limonciello
  Cc: Wei Yongjun, platform-driver-x86

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>
---
 drivers/platform/x86/dell-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index c4903c5..0a8f359 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -2081,8 +2081,10 @@ static int __init dell_init(void)
 	}
 
 	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
-	if (!buffer)
+	if (!buffer) {
+		ret = -ENOMEM;
 		goto fail_buffer;
+	}
 
 	if (quirks && quirks->touchpad_led)
 		touchpad_led_init(&platform_device->dev);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-23  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 13:40 [PATCH -next] platform/x86: dell-laptop: fix error return code in dell_init() Wei Yongjun
2017-11-14 14:38 ` Mario.Limonciello
2017-11-21 14:23   ` Andy Shevchenko
2017-11-22  0:00     ` Darren Hart
2017-11-23  9:03 ` Pali Rohár

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.