Skip to content

Commit

Permalink
[PATCH] block: handle subsystem_register() init errors
Browse files Browse the repository at this point in the history
Check and handle init errors.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
rddunlap authored and Linus Torvalds committed Sep 29, 2006
1 parent 4d7dd8f commit 87a5726
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,15 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data)

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);
Expand Down

0 comments on commit 87a5726

Please sign in to comment.