Przeglądaj źródła

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

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>
Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Mario Limonciello 8 lat temu
rodzic
commit
5246741a3f
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      drivers/platform/x86/dell-laptop.c

+ 5 - 4
drivers/platform/x86/dell-laptop.c

@@ -2073,6 +2073,11 @@ static int __init dell_init(void)
 	if (ret)
 	if (ret)
 		goto fail_platform_device2;
 		goto fail_platform_device2;
 
 
+	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
+	if (!buffer)
+		goto fail_buffer;
+
+
 	ret = dell_setup_rfkill();
 	ret = dell_setup_rfkill();
 
 
 	if (ret) {
 	if (ret) {
@@ -2080,10 +2085,6 @@ static int __init dell_init(void)
 		goto fail_rfkill;
 		goto fail_rfkill;
 	}
 	}
 
 
-	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
-	if (!buffer)
-		goto fail_buffer;
-
 	if (quirks && quirks->touchpad_led)
 	if (quirks && quirks->touchpad_led)
 		touchpad_led_init(&platform_device->dev);
 		touchpad_led_init(&platform_device->dev);