diff options
author | Hou Tao <houtao1@huawei.com> | 2017-02-03 17:19:07 +0800 |
---|---|---|
committer | Todd Kjos <tkjos@google.com> | 2018-05-31 15:31:30 -0700 |
commit | 201e2f531b3634b29739aea517b86f3a138ee0f3 (patch) | |
tree | 47159c70470725219f476f0c854430133c4f2978 | |
parent | 9a8bf8ca0860c97a63c195f64d08d065ad50bf7e (diff) |
blkcg: fix double free of new_blkg in blkcg_init_queueASB-2018-06-05_4.4-o-release
commit 9b54d816e00425c3a517514e0d677bb3cec49258 upstream.
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>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 8161090a1970..46ba2402c8f9 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1078,10 +1078,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; |