Skip to contentSkip to conversation

platform/x86: dell-laptop: fix error return code in dell_init()

PATCH In review Wei Yongjun 5 participants 5 messages Nov 14, 2017 – Nov 23, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/platform/x86/dell-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/dell-laptop.c +3 -1
index c4903c5..0a8f359 100644
@@ -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);
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines

-----Original Message-----
From: [email protected] [mailto:platform-driver-x86- [email protected]] On Behalf Of Wei Yongjun
Sent: Tuesday, November 14, 2017 7:40 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>
Cc: Wei Yongjun <[email protected]>; platform-driver- [email protected]
Subject: [PATCH -next] 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")

---
 drivers/platform/x86/dell-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/dell-laptop.c +0 -0
index c4903c5..0a8f359 100644
@@ -2081,8 +2081,10 @@ static int __init dell_init(void)
 	}

drivers/platform/x86/dell-laptop.c static int __init dell_init(void) · line 2090

Quoted 10 lines
drivers/platform/x86/dell-laptop.c +3 -1
 
 	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);

Thanks.

#2 lore raw
Quoted 10 lines · On Tue, Nov 14, 2017 at 4:38 PM, <[email protected]> wrote:
Quoted 10 lines

-----Original Message-----
From: [email protected] [mailto:platform-driver-x86- [email protected]] On Behalf Of Wei Yongjun
Sent: Tuesday, November 14, 2017 7:40 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>
Cc: Wei Yongjun <[email protected]>; platform-driver- [email protected]
Subject: [PATCH -next] platform/x86: dell-laptop: fix error return code in dell_init()

Quoted 6 lines
Quoted 6 lines

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")

Pushed to my review and testing queue, thanks.

Shall we send this as material for -rc2 ?

Quoted 24 lines
Quoted 10 lines
---
 drivers/platform/x86/dell-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/dell-laptop.c +0 -0
index c4903c5..0a8f359 100644
@@ -2081,8 +2081,10 @@ static int __init dell_init(void)
      }

drivers/platform/x86/dell-laptop.c static int __init dell_init(void) · line 2090

Quoted 10 lines
drivers/platform/x86/dell-laptop.c +3 -1
 
      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);

Thanks.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · On Tue, Nov 14, 2017 at 4:38 PM, <[email protected]> wrote:
Quoted 13 lines

-----Original Message-----
From: [email protected] [mailto:platform-driver-x86- [email protected]] On Behalf Of Wei Yongjun
Sent: Tuesday, November 14, 2017 7:40 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>
Cc: Wei Yongjun <[email protected]>; platform-driver- [email protected]
Subject: [PATCH -next] 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.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Fixes 549b4930f057 ("platform/x86: dell-smbios: Introduce dispatcher for SMM

calls")

Pushed to my review and testing queue, thanks.

Shall we send this as material for -rc2 ?

I have one more queued in for-next already. So pleasae propogate this to for-next along with anything else you want to go out and I'll send the pull request tomorrow (Wed) to Linus. Then we'll do our transition to "Fixes" for the RC cycle (a bit later than usual).

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
Reviewed-by on v1 1/1
#4 lore raw
In reply to Wei Yongjun
Quoted 5 lines · On Tuesday 14 November 2017 13:40:13 Wei Yongjun wrote:

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")

Looks good,

Quoted 21 lines
---
 drivers/platform/x86/dell-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/dell-laptop.c +3 -1
index c4903c5..0a8f359 100644
@@ -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);
Signature · 2 lines
Pali Rohár
[email protected]