Skip to content

Commit 9b54d81

Browse files
Hou Taoaxboe
Hou Tao
authored andcommitted
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>
1 parent 0cacba6 commit 9b54d81

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: block/blk-cgroup.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1079,10 +1079,8 @@ int blkcg_init_queue(struct request_queue *q)
10791079
if (preloaded)
10801080
radix_tree_preload_end();
10811081

1082-
if (IS_ERR(blkg)) {
1083-
blkg_free(new_blkg);
1082+
if (IS_ERR(blkg))
10841083
return PTR_ERR(blkg);
1085-
}
10861084

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

0 commit comments

Comments
 (0)