aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-05-14 16:52:30 -0400
committerTejun Heo <tj@kernel.org>2013-05-14 16:52:30 -0400
commit2423c9c3f0ffffa8f87cbdafe9781273c5d1b6a2 (patch)
tree6ddb6e8f4cd577adab194c90eccec5ad50f2ab08 /block
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
blkcg: fix error return path in blkg_create()
In blkg_create(), after lookup of parent fails, the control jumps to error path with the error code encoded into @blkg. The error path doesn't use @blkg for the return value. It returns ERR_PTR(ret). Make lookup fail path set @ret instead of @blkg. Note that the parent lookup is guaranteed to succeed at that point and the condition check is purely for sanity and triggers WARN when fails. As such, I don't think it's necessary to mark it for -stable. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index e8918ffaf96d..7fc35f683c4e 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -238,7 +238,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
238 if (blkcg_parent(blkcg)) { 238 if (blkcg_parent(blkcg)) {
239 blkg->parent = __blkg_lookup(blkcg_parent(blkcg), q, false); 239 blkg->parent = __blkg_lookup(blkcg_parent(blkcg), q, false);
240 if (WARN_ON_ONCE(!blkg->parent)) { 240 if (WARN_ON_ONCE(!blkg->parent)) {
241 blkg = ERR_PTR(-EINVAL); 241 ret = -EINVAL;
242 goto err_put_css; 242 goto err_put_css;
243 } 243 }
244 blkg_get(blkg->parent); 244 blkg_get(blkg->parent);