Skip to content

Commit

Permalink
WMI: properly cleanup devices to avoid crashes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Matthew Garrett committed Oct 24, 2011
1 parent 349d594 commit 023b956
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 023b956

Please sign in to comment.