]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
block: fix memory leak for elevator on add_disk failure
authorYu Kuai <yukuai3@huawei.com>
Sat, 22 Oct 2022 02:16:15 +0000 (10:16 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 22 Oct 2022 21:14:38 +0000 (15:14 -0600)
commit02341a08c9dec5a88527981b0bdf0fb6f7499cbf
tree8f07b907b29715c6f55769aa852192ba73152f74
parent2db96217e7e515071726ca4ec791742c4202a1b2
block: fix memory leak for elevator on add_disk failure

The default elevator is allocated in the beginning of device_add_disk(),
however, it's not freed in the following error path.

Fixes: 50e34d78815e ("block: disable the elevator int del_gendisk")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20221022021615.2756171-1-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c