block: fix compiler warning in genhd.c

Warn if something really bad happens if we can't create this link.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2008-05-22 17:21:08 -04:00
parent 695794ae0c
commit 6ffeea77ff
1 changed files with 3 additions and 1 deletions

View File

@ -183,6 +183,7 @@ static int exact_lock(dev_t devt, void *data)
void add_disk(struct gendisk *disk)
{
struct backing_dev_info *bdi;
int retval;
disk->flags |= GENHD_FL_UP;
blk_register_region(MKDEV(disk->major, disk->first_minor),
@ -193,7 +194,8 @@ void add_disk(struct gendisk *disk)
bdi = &disk->queue->backing_dev_info;
bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor));
sysfs_create_link(&disk->dev.kobj, &bdi->dev->kobj, "bdi");
retval = sysfs_create_link(&disk->dev.kobj, &bdi->dev->kobj, "bdi");
WARN_ON(retval);
}
EXPORT_SYMBOL(add_disk);