summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
authorPiotr Haber2012-10-11 14:05:15 +0200
committerJohn W. Linville2012-10-15 20:45:51 +0200
commit1fffa905adffbf0d3767fc978ef09afb830275eb (patch)
tree8e6d79639618a2bd4706f419eab2af74d5972578 /drivers/bcma/main.c
parentmac80211: use ieee80211_free_txskb in a few more places (diff)
downloadkernel-qcow2-linux-1fffa905adffbf0d3767fc978ef09afb830275eb.tar.gz
kernel-qcow2-linux-1fffa905adffbf0d3767fc978ef09afb830275eb.tar.xz
kernel-qcow2-linux-1fffa905adffbf0d3767fc978ef09afb830275eb.zip
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 <sgruszka@redhat.com> Reviewed-by: Arend Van Spriel <arend@broadcom.com> Signed-off-by: Piotr Haber <phaber@broadcom.com> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/main.c')
-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 432aeeedfd5e..d865470bc951 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -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);
}