diff options
author | Hou Tao <houtao1@huawei.com> | 2017-02-03 04:19:07 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-02-03 09:52:35 -0500 |
commit | 9b54d816e00425c3a517514e0d677bb3cec49258 (patch) | |
tree | 4316604c3430ab596be3b6e6a120de23a384a541 | |
parent | 0cacba6cf8252438f8166bd3fa1c3370dd28a769 (diff) |
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>
-rw-r--r-- | block/blk-cgroup.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 37fe595cfd70..295e98c2c8cc 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -1079,10 +1079,8 @@ int blkcg_init_queue(struct request_queue *q) | |||
1079 | if (preloaded) | 1079 | if (preloaded) |
1080 | radix_tree_preload_end(); | 1080 | radix_tree_preload_end(); |
1081 | 1081 | ||
1082 | if (IS_ERR(blkg)) { | 1082 | if (IS_ERR(blkg)) |
1083 | blkg_free(new_blkg); | ||
1084 | return PTR_ERR(blkg); | 1083 | return PTR_ERR(blkg); |
1085 | } | ||
1086 | 1084 | ||
1087 | q->root_blkg = blkg; | 1085 | q->root_blkg = blkg; |
1088 | q->root_rl.blkg = blkg; | 1086 | q->root_rl.blkg = blkg; |