All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] WMI: properly cleanup devices to avoid crashes
@ 2011-09-07 22:00 Dmitry Torokhov
  2011-10-06 22:40 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2011-09-07 22:00 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Carlos Corbacho, Colin Ian King, platform-driver-x86

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

 drivers/platform/x86/wmi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index f23d5a8..9b88be4 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-08  5:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-07 22:00 [PATCH] WMI: properly cleanup devices to avoid crashes Dmitry Torokhov
2011-10-06 22:40 ` Dmitry Torokhov
2011-10-08  5:54   ` Carlos Corbacho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.