Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 023b9565 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Matthew Garrett
Browse files

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: default avatarIlya Tumaykin <librarian_rus@yahoo.com>
Cc: stable@kernel.org
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarCarlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 349d594b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)