aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Haber <phaber@broadcom.com>2012-10-11 14:05:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-31 09:51:37 -0700
commit0ff8913490f238812b4ab9f0b5cf7797f9a08aa7 (patch)
treef455354cc9d93c9a17cb478aa8ef2fbb58ae7ee4
parent0dab9d11a7900ebd2be763831e686c1da4789166 (diff)
downloadkernel_samsung_crespo-0ff8913490f238812b4ab9f0b5cf7797f9a08aa7.zip
kernel_samsung_crespo-0ff8913490f238812b4ab9f0b5cf7797f9a08aa7.tar.gz
kernel_samsung_crespo-0ff8913490f238812b4ab9f0b5cf7797f9a08aa7.tar.bz2
bcma: fix unregistration of cores
commit 1fffa905adffbf0d3767fc978ef09afb830275eb 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>
-rw-r--r--drivers/bcma/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index be52344..a9cb238 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -110,9 +110,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);
}