aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-09-07 18:00:02 -0400
committerMatthew Garrett <mjg@redhat.com>2011-10-24 10:52:40 -0400
commit023b9565972a4a5e0f01b9aa32680af6e9b5c388 (patch)
tree1d3260147d92bd3feddf077564cbc0029f758e51 /drivers/platform
parent349d594be45bdc7a86a08385f2f4f49d08ab68dd (diff)
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 <librarian_rus@yahoo.com> Cc: stable@kernel.org Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/wmi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index f23d5a84e7b1..9b88be42b6cd 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -754,9 +754,13 @@ static void wmi_free_devices(void)
754 struct wmi_block *wblock, *next; 754 struct wmi_block *wblock, *next;
755 755
756 /* Delete devices for all the GUIDs */ 756 /* Delete devices for all the GUIDs */
757 list_for_each_entry_safe(wblock, next, &wmi_block_list, list) 757 list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
758 list_del(&wblock->list);
758 if (wblock->dev.class) 759 if (wblock->dev.class)
759 device_unregister(&wblock->dev); 760 device_unregister(&wblock->dev);
761 else
762 kfree(wblock);
763 }
760} 764}
761 765
762static bool guid_already_parsed(const char *guid_string) 766static bool guid_already_parsed(const char *guid_string)