aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Yuan <tailai.ly@taobao.com>2011-04-19 13:47:58 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-09 16:04:34 -0700
commit3984c935c54a61eb6d12bcde228d9d5814f53f19 (patch)
treefd307ebe529e9fab514010f71fa6c56659c0b7f5
parente6fe8008a04250492fb38c84e046cf828ad5546a (diff)
block, blk-sysfs: Fix an err return path in blk_register_queue()
commit ed5302d3c25006a9edc7a7fbea97a30483f89ef7 upstream. We do not call blk_trace_remove_sysfs() in err return path if kobject_add() fails. This path fixes it. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--block/blk-sysfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 8606c9543fd..cdb80488a0e 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -473,8 +473,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);