diff mbox

platform/x86: dell-laptop: Allocate buffer before rfkill use

Message ID 1510777273-31322-1-git-send-email-mario.limonciello@dell.com (mailing list archive)
State Accepted, archived
Delegated to: Darren Hart
Headers show

Commit Message

Limonciello, Mario Nov. 15, 2017, 8:21 p.m. UTC
On machines using rfkill interface the buffer needs to have been
allocated before the initial use (memset) of it.

Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/dell-laptop.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Valdis Klētnieks Nov. 16, 2017, 3:55 a.m. UTC | #1
On Wed, 15 Nov 2017 14:21:13 -0600, Mario Limonciello said:
> On machines using rfkill interface the buffer needs to have been
> allocated before the initial use (memset) of it.
>
> Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
>  drivers/platform/x86/dell-laptop.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Works here, thanks.  Feel free to stick a Tested-By: on it ;)
Darren Hart Nov. 17, 2017, 1:52 a.m. UTC | #2
On Wed, Nov 15, 2017 at 02:21:13PM -0600, Mario Limonciello wrote:
> On machines using rfkill interface the buffer needs to have been
> allocated before the initial use (memset) of it.
> 
> Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

Queued, thanks Valdis and Mario.
diff mbox

Patch

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index c4903c5..2d70436 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -2073,6 +2073,11 @@  static int __init dell_init(void)
 	if (ret)
 		goto fail_platform_device2;
 
+	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
+	if (!buffer)
+		goto fail_buffer;
+
+
 	ret = dell_setup_rfkill();
 
 	if (ret) {
@@ -2080,10 +2085,6 @@  static int __init dell_init(void)
 		goto fail_rfkill;
 	}
 
-	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
-	if (!buffer)
-		goto fail_buffer;
-
 	if (quirks && quirks->touchpad_led)
 		touchpad_led_init(&platform_device->dev);