aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blk-cgroup.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 201275467d8b..18ae48083f4a 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -187,16 +187,16 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
187 187
188 /* blkg holds a reference to blkcg */ 188 /* blkg holds a reference to blkcg */
189 if (!css_tryget(&blkcg->css)) { 189 if (!css_tryget(&blkcg->css)) {
190 blkg = ERR_PTR(-EINVAL); 190 ret = -EINVAL;
191 goto out_free; 191 goto err_free_blkg;
192 } 192 }
193 193
194 /* allocate */ 194 /* allocate */
195 if (!new_blkg) { 195 if (!new_blkg) {
196 new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC); 196 new_blkg = blkg_alloc(blkcg, q, GFP_ATOMIC);
197 if (unlikely(!new_blkg)) { 197 if (unlikely(!new_blkg)) {
198 blkg = ERR_PTR(-ENOMEM); 198 ret = -ENOMEM;
199 goto out_put; 199 goto err_put_css;
200 } 200 }
201 } 201 }
202 blkg = new_blkg; 202 blkg = new_blkg;
@@ -213,12 +213,11 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
213 if (!ret) 213 if (!ret)
214 return blkg; 214 return blkg;
215 215
216 blkg = ERR_PTR(ret); 216err_put_css:
217out_put:
218 css_put(&blkcg->css); 217 css_put(&blkcg->css);
219out_free: 218err_free_blkg:
220 blkg_free(new_blkg); 219 blkg_free(new_blkg);
221 return blkg; 220 return ERR_PTR(ret);
222} 221}
223 222
224/** 223/**