mmc: fix disk/queue leak in case of adding disk failure
Subsystems (2)
PATCH 1/1 mmc: fix disk/queue leak in case of adding disk failure
In case of adding disk failure, the disk needs to be released, otherwise disk/queue is leaked.
Signed-off-by Ming Lei <[email protected]>
--- drivers/mmc/core/block.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/core/block.c +3 -2
@@ -2505,10 +2505,11 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,dev_set_drvdata (&card->dev, md); ret =device_add_disk (md->parent, md->disk, mmc_disk_attr_groups);if (ret) - goto err_cleanup_queue; + goto err_put_disk;return md; - err_cleanup_queue: + err_put_disk: +put_disk (md->disk);blk_mq_free_tag_set (&md->queue.tag_set); err_kfree:kfree (md);
Signature · 1 line
2.31.1
Quoted 4 lines · Ming Lei
In case of adding disk failure, the disk needs to be released, otherwise disk/queue is leaked.
Applied, thanks!
[1/1] mmc: fix disk/queue leak in case of adding disk failure
commit: bf14fad19ffbb3d37a1bb1324f966973e7d4a7b6
Best regards,
Signature · 1 line
Jens Axboe