lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] platform/x86: dell-laptop: Allocate buffer before rfkill use
Date
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(-)

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

--
2.7.4
\
 
 \ /
  Last update: 2017-11-15 21:23    [W:0.043 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site