Skip to content

Commit 44b977a

Browse files
gluediggregkh
authored andcommitted
bcma: fix unregistration of cores
commit 1fffa90 upstream. 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]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7e8cec3 commit 44b977a

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
@@ -131,9 +131,10 @@ static int bcma_register_cores(struct bcma_bus *bus)
131131

132132
static void bcma_unregister_cores(struct bcma_bus *bus)
133133
{
134-
struct bcma_device *core;
134+
struct bcma_device *core, *tmp;
135135

136-
list_for_each_entry(core, &bus->cores, list) {
136+
list_for_each_entry_safe(core, tmp, &bus->cores, list) {
137+
list_del(&core->list);
137138
if (core->dev_registered)
138139
device_unregister(&core->dev);
139140
}

0 commit comments

Comments
 (0)