Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4905894d authored by Hou Tao's avatar Hou Tao Committed by Srinivasa Rao Kuppala
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.

Change-Id: I35bb8601143a33f35cfcb0b1ffba6788ec184a20
Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Git-commit: 9b54d816e00425c3a517514e0d677bb3cec49258
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarSrinivasa Rao Kuppala <srkupp@codeaurora.org>
parent 86b59907
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;