aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-05-14 13:52:30 -0700
committerMoyster <oysterized@gmail.com>2016-09-18 12:46:39 +0200
commit4ce7f281d6e0df162727b6db0ade1f5e5117b017 (patch)
tree8355c0cf56daf6e8c9c51833d70ed8c50b1b1a49 /block
parent002c98cf5b0aefa2e74262caf71bbf38a6e06e79 (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 d7fc7ae7f..6c6384642 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -238,7 +238,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
if (blkcg_parent(blkcg)) {
blkg->parent = __blkg_lookup(blkcg_parent(blkcg), q, false);
if (WARN_ON_ONCE(!blkg->parent)) {
- blkg = ERR_PTR(-EINVAL);
+ ret = -EINVAL;
goto err_put_css;
}
blkg_get(blkg->parent);