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

Commit 1fffa905 authored by Piotr Haber's avatar Piotr Haber Committed by John W. Linville
Browse files

bcma: fix unregistration of cores



When cores are unregistered, entries
need to be removed from cores list in a safe manner.

Reported-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Signed-off-by: default avatarPiotr Haber <phaber@broadcom.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d4fa14cd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -158,9 +158,10 @@ static int bcma_register_cores(struct bcma_bus *bus)

static void bcma_unregister_cores(struct bcma_bus *bus)
{
	struct bcma_device *core;
	struct bcma_device *core, *tmp;

	list_for_each_entry(core, &bus->cores, list) {
	list_for_each_entry_safe(core, tmp, &bus->cores, list) {
		list_del(&core->list);
		if (core->dev_registered)
			device_unregister(&core->dev);
	}