diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/floppy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 401ba783321..9baf11e8636 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4585,6 +4585,15 @@ static void __exit floppy_module_exit(void) platform_device_unregister(&floppy_device[drive]); } blk_cleanup_queue(disks[drive]->queue); + + /* + * These disks have not called add_disk(). Don't put down + * queue reference in put_disk(). + */ + if (!(allowed_drive_mask & (1 << drive)) || + fdc_state[FDC(drive)].version == FDC_NONE) + disks[drive]->queue = NULL; + put_disk(disks[drive]); } |