]> git.baikalelectronics.ru Git - kernel.git/commit
blkcg: use blkg_free() in blkcg_init_queue() failure path
authorTejun Heo <tj@kernel.org>
Tue, 18 Aug 2015 21:55:07 +0000 (14:55 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 18 Aug 2015 22:49:16 +0000 (15:49 -0700)
commitd0f3778a8d921cd380a414de401590ca1d2e736b
tree00b10beb44185de1f5739e7c393959ce268c3296
parentf6cfa5710147b0978cdcc2ad293b5d37ec3d0e00
blkcg: use blkg_free() in blkcg_init_queue() failure path

When blkcg_init_queue() fails midway after creating a new blkg, it
performs kfree() directly; however, this doesn't free the policy data
areas.  Make it use blkg_free() instead.  In turn, blkg_free() is
updated to handle root request_list special case.

While this fixes a possible memory leak, it's on an unlikely failure
path of an already cold path and the size leaked per occurrence is
miniscule too.  I don't think it needs to be tagged for -stable.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-cgroup.c