Skip to content

Commit 1fffa90

Browse files
gluediglinvjw
authored andcommitted
bcma: fix unregistration of cores
When cores are unregistered, entries need to be removed from cores list in a safe manner. Reported-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Arend Van Spriel <[email protected]> Signed-off-by: Piotr Haber <[email protected]> Cc: [email protected] Signed-off-by: John W. Linville <[email protected]>
1 parent d4fa14c commit 1fffa90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/bcma/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ static int bcma_register_cores(struct bcma_bus *bus)
158158

159159
static void bcma_unregister_cores(struct bcma_bus *bus)
160160
{
161-
struct bcma_device *core;
161+
struct bcma_device *core, *tmp;
162162

163-
list_for_each_entry(core, &bus->cores, list) {
163+
list_for_each_entry_safe(core, tmp, &bus->cores, list) {
164+
list_del(&core->list);
164165
if (core->dev_registered)
165166
device_unregister(&core->dev);
166167
}

0 commit comments

Comments
 (0)