Skip to contentSkip to conversation

block: handle subsystem_register init errors

PATCH New Randy.Dunlap 1 participant 1 message Jul 12, 2006 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: handle subsystem_register init errors

From: Randy Dunlap <[email protected]>

Check and handle init errors.

---
 block/genhd.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
block/genhd.c +7 -2
@@ -295,10 +295,15 @@ static struct kobject *base_probe(dev_t 
 
 static int __init genhd_device_init(void)
 {
+	int err;
+
 	bdev_map = kobj_map_init(base_probe, &block_subsys_lock);
 	blk_dev_init();
-	subsystem_register(&block_subsys);
-	return 0;
+	err = subsystem_register(&block_subsys);
+	if (err < 0)
+		printk(KERN_WARNING "%s: subsystem_register error: %d\n",
+			__FUNCTION__, err);
+	return err;
 }
 
 subsys_initcall(genhd_device_init);

---