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: stable@kernel.org Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
d350e6b6e8
commit
ed5302d3c2
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue