diff options
author | Piotr Haber <phaber@broadcom.com> | 2012-10-11 08:05:15 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-15 14:45:51 -0400 |
commit | 1fffa905adffbf0d3767fc978ef09afb830275eb (patch) | |
tree | 8e6d79639618a2bd4706f419eab2af74d5972578 /drivers/bcma | |
parent | d4fa14cd62bd078c8e3ef39283b9f237e5b2ff0f (diff) |
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')
-rw-r--r-- | drivers/bcma/main.c | 5 |
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) | |||
158 | 158 | ||
159 | static void bcma_unregister_cores(struct bcma_bus *bus) | 159 | static void bcma_unregister_cores(struct bcma_bus *bus) |
160 | { | 160 | { |
161 | struct bcma_device *core; | 161 | struct bcma_device *core, *tmp; |
162 | 162 | ||
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); | ||
164 | if (core->dev_registered) | 165 | if (core->dev_registered) |
165 | device_unregister(&core->dev); | 166 | device_unregister(&core->dev); |
166 | } | 167 | } |