WMI: properly cleanup devices to avoid crashes
PATCH 1/1 WMI: properly cleanup devices to avoid crashes
We need to remove devices that we destroy from the list, otherwise we'll crash if there are more than one "_WDG" methods in DSDT.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052
Tested-by Ilya Tumaykin <[email protected]>
Signed-off-by Dmitry Torokhov <[email protected]>
---
drivers/platform/x86/wmi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/platform/x86/wmi.c +5 -1
@@ -754,9 +754,13 @@ static void wmi_free_devices(void)struct wmi_block *wblock, *next;/* Delete devices for all the GUIDs */ -list_for_each_entry_safe (wblock, next, &wmi_block_list, list) +list_for_each_entry_safe (wblock, next, &wmi_block_list, list) { +list_del (&wblock->list);if (wblock->dev.class)device_unregister (&wblock->dev); +else +kfree (wblock); + } }static bool guid_already_parsed (const char *guid_string)
Quoted 9 lines · Dmitry Torokhov
We need to remove devices that we destroy from the list, otherwise we'll crash if there are more than one "
_WDG" methods in DSDT.This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052
Tested-by Ilya Tumaykin <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
* ping *
Quoted 24 lines
drivers/platform/x86/wmi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)drivers/platform/x86/wmi.c +5
-1@@ -754,9 +754,13 @@ static void wmi_free_devices(void)struct wmi_block *wblock, *next;/* Delete devices for all the GUIDs */ -list_for_each_entry_safe (wblock, next, &wmi_block_list, list) +list_for_each_entry_safe (wblock, next, &wmi_block_list, list) { +list_del (&wblock->list);if (wblock->dev.class)device_unregister (&wblock->dev); +else +kfree (wblock); + } }static bool guid_already_parsed (const char *guid_string)
Signature · 1 line
Dmitry
Carlos Corbacho
Acked-byQuoted 9 lines · On Thursday 06 Oct 2011 15:40:44 Dmitry Torokhov wrote:
Quoted 8 lines · Dmitry Torokhov
We need to remove devices that we destroy from the list, otherwise we'll crash if there are more than one "
_WDG" methods in DSDT.This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052
Tested-by Ilya Tumaykin <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>
Acked-by Carlos Corbacho <[email protected]>
Quoted 32 lines
Quoted 1 line
---
* ping *
Quoted 28 lines
drivers/platform/x86/wmi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)drivers/platform/x86/wmi.c +5
-1@@ -754,9 +754,13 @@ static void wmi_free_devices(void)struct wmi_block *wblock, *next;/* Delete devices for all the GUIDs */ -list_for_each_entry_safe (wblock, next, &wmi_block_list, list) +list_for_each_entry_safe (wblock, next, &wmi_block_list, list) { +list_del (&wblock->list);if (wblock->dev.class)device_unregister (&wblock->dev); +else +kfree (wblock); + } }static bool guid_already_parsed (const char *guid_string)