summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2003-03-23 02:07:07 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-03-23 02:07:07 -0800
commit8bc68ca891752bbb07a198215a9c1ebaedf90ada (patch)
tree999758c4158c92bf4b6d40d4330a12413ca3db3e /drivers
parent9409259d432a009c1b68857c2b633786050ae63e (diff)
[PATCH] Make ide use proper removal-safe list handling (removes endless looping / hang)
Fix the IDE hang people see with 2.5.65-bk From Dominik Brodowski <linux@brodo.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0cd9927b16a2..c5d59ccfa366 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -2392,6 +2392,8 @@ static int ide_drive_remove(struct device * dev)
int ide_register_driver(ide_driver_t *driver)
{
struct list_head list;
+ struct list_head *list_loop;
+ struct list_head *tmp_storage;
spin_lock(&drivers_lock);
list_add(&driver->drivers, &drivers);
@@ -2402,8 +2404,8 @@ int ide_register_driver(ide_driver_t *driver)
list_splice_init(&ata_unused, &list);
spin_unlock(&drives_lock);
- while (!list_empty(&list)) {
- ide_drive_t *drive = list_entry(list.next, ide_drive_t, list);
+ list_for_each_safe(list_loop, tmp_storage, &list) {
+ ide_drive_t *drive = container_of(list_loop, ide_drive_t, list);
list_del_init(&drive->list);
if (drive->present)
ata_attach(drive);