Skip to contentSkip to conversation

floppy: handle device_create_file() failure while init

PATCH New Dmitriy Monakhov 1 participant 1 message Mar 2, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 floppy: handle device_create_file() failure while init

This patch kills the "ignoring return value of 'device_create_file'" warning message.

---
 drivers/block/floppy.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/block/floppy.c +6 -1
index 567c630..dfdabc3 100644
@@ -4333,7 +4333,10 @@ static int __init floppy_init(void)
 		if (err)
 			goto out_flush_work;
 
-		device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
+		err = device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
+		if (err)
+			goto out_unreg_platform_dev;
+
 		/* to be cleaned up... */
 		disks[drive]->private_data = (void *)(long)drive;
 		disks[drive]->queue = floppy_queue;
@@ -4344,6 +4347,8 @@ static int __init floppy_init(void)
 
 	return 0;
 
+out_unreg_platform_dev:
+	platform_device_unregister(&floppy_device[drive]);
 out_flush_work:
 	flush_scheduled_work();
 	if (usage_count)
Signature · 1 line
1.4.4.2