Commit 343bf06b authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide-disk.c: fix for IDE CF card ejection with devfs

From: Pavel Roskin <proski@gnu.org>

If I eject IDE CompactFlash card, I get a stack dump from
devfs_remove() because ide/host2/bus0/target0/lun0 doesn't exist.

After del_gendisk() is called from idedisk_cleanup() drive->devfs_name refers
to a non-existent directory and should be erased, so that ide_unregister()
doesn't try to remove that directory again.
parent 0fa272e5
...@@ -1695,6 +1695,7 @@ static int idedisk_cleanup (ide_drive_t *drive) ...@@ -1695,6 +1695,7 @@ static int idedisk_cleanup (ide_drive_t *drive)
if (ide_unregister_subdriver(drive)) if (ide_unregister_subdriver(drive))
return 1; return 1;
del_gendisk(g); del_gendisk(g);
drive->devfs_name[0] = '\0';
g->fops = ide_fops; g->fops = ide_fops;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment