mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
bcma: fix unregistration of cores
commit 1fffa905ad upstream.
When cores are unregistered, entries
need to be removed from cores list in a safe manner.
Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7e8cec3211
commit
44b977a873
|
|
@ -131,9 +131,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user