diff options
-rw-r--r-- | drivers/block/floppy.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 5231ed7e723f..3587cb434371 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4334,7 +4334,10 @@ static int __init floppy_init(void) | |||
4334 | if (err) | 4334 | if (err) |
4335 | goto out_flush_work; | 4335 | goto out_flush_work; |
4336 | 4336 | ||
4337 | device_create_file(&floppy_device[drive].dev,&dev_attr_cmos); | 4337 | err = device_create_file(&floppy_device[drive].dev,&dev_attr_cmos); |
4338 | if (err) | ||
4339 | goto out_unreg_platform_dev; | ||
4340 | |||
4338 | /* to be cleaned up... */ | 4341 | /* to be cleaned up... */ |
4339 | disks[drive]->private_data = (void *)(long)drive; | 4342 | disks[drive]->private_data = (void *)(long)drive; |
4340 | disks[drive]->queue = floppy_queue; | 4343 | disks[drive]->queue = floppy_queue; |
@@ -4345,6 +4348,8 @@ static int __init floppy_init(void) | |||
4345 | 4348 | ||
4346 | return 0; | 4349 | return 0; |
4347 | 4350 | ||
4351 | out_unreg_platform_dev: | ||
4352 | platform_device_unregister(&floppy_device[drive]); | ||
4348 | out_flush_work: | 4353 | out_flush_work: |
4349 | flush_scheduled_work(); | 4354 | flush_scheduled_work(); |
4350 | if (usage_count) | 4355 | if (usage_count) |