mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 13:58:46 +00:00
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
@ -508,8 +508,10 @@ int blk_register_queue(struct gendisk *disk)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
|
ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
blk_trace_remove_sysfs(dev);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
kobject_uevent(&q->kobj, KOBJ_ADD);
|
kobject_uevent(&q->kobj, KOBJ_ADD);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user