Skip to content
  • Tejun Heo's avatar
    blkcg: use blkg_free() in blkcg_init_queue() failure path · 994b7832
    Tejun Heo authored
    
    
    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: default avatarTejun Heo <tj@kernel.org>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    994b7832