Skip to content
Permalink
Browse files

blkcg: fix double free of new_blkg in blkcg_init_queue

If blkg_create fails, new_blkg passed as an argument will
be freed by blkg_create, so there is no need to free it again.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information...
Hou Tao authored and axboe committed Feb 3, 2017
1 parent 0cacba6 commit 9b54d816e00425c3a517514e0d677bb3cec49258
Showing with 1 addition and 3 deletions.
  1. +1 −3 block/blk-cgroup.c
@@ -1079,10 +1079,8 @@ int blkcg_init_queue(struct request_queue *q)
if (preloaded)
radix_tree_preload_end();

if (IS_ERR(blkg)) {
blkg_free(new_blkg);
if (IS_ERR(blkg))
return PTR_ERR(blkg);
}

q->root_blkg = blkg;
q->root_rl.blkg = blkg;

0 comments on commit 9b54d81

Please sign in to comment.
You can’t perform that action at this time.