block, blk-sysfs: Fix an err return path in blk_register_queue()

We do not call blk_trace_remove_sysfs() in err return path
if kobject_add() fails. This path fixes it.

Cc: [email protected]
Signed-off-by: Liu Yuan <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Liu Yuan 2011-04-19 13:47:58 +02:00 • committed by Jens Axboe
commit ed5302d3c2

View file

@ -508,8 +508,10 @@ int blk_register_queue(struct gendisk *disk)
return ret;
ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
if (ret < 0)
if (ret < 0) {
blk_trace_remove_sysfs(dev);
return ret;
}
kobject_uevent(&q->kobj, KOBJ_ADD);