projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe3333f
)
mmc: fix disk/queue leak in case of adding disk failure
author
Ming Lei
<ming.lei@redhat.com>
Mon, 18 Jul 2022 16:08:51 +0000
(
00:08
+0800)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 18 Jul 2022 19:12:11 +0000
(13:12 -0600)
In case of adding disk failure, the disk needs to be released, otherwise
disk/queue is leaked.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link:
https://lore.kernel.org/r/20220718160851.312972-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/mmc/core/block.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/core/block.c
b/drivers/mmc/core/block.c
index
bda6c67
..
e08e22f
100644
(file)
--- a/
drivers/mmc/core/block.c
+++ b/
drivers/mmc/core/block.c
@@
-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);