* [PATCH RESEND] blkcg: fix double free of new_blkg in blkcg_init_queue
@ 2017-02-03 9:19 Hou Tao
2017-02-03 15:25 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Hou Tao @ 2017-02-03 9:19 UTC (permalink / raw)
To: linux-block; +Cc: axboe, tj
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>
---
block/blk-cgroup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 8ba0af7..f570f38 100644
--- a/block/blk-cgroup.c
+++ b/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;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-03 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03 9:19 [PATCH RESEND] blkcg: fix double free of new_blkg in blkcg_init_queue Hou Tao
2017-02-03 15:25 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox