All of lore.kernel.org
 help / color / mirror / Atom feed
* [for-5.20/block PATCH] mmc: fix disk/queue leak in case of adding disk failure
@ 2022-07-18 16:08 Ming Lei
  2022-07-18 19:13 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2022-07-18 16:08 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, linux-block, Ming Lei

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>
---
 drivers/mmc/core/block.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index bda6c67ce93f..e08e22f0a7c5 100644
--- 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);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [for-5.20/block PATCH] mmc: fix disk/queue leak in case of adding disk failure
  2022-07-18 16:08 [for-5.20/block PATCH] mmc: fix disk/queue leak in case of adding disk failure Ming Lei
@ 2022-07-18 19:13 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-07-18 19:13 UTC (permalink / raw)
  To: ming.lei; +Cc: Christoph Hellwig, linux-block

On Tue, 19 Jul 2022 00:08:51 +0800, Ming Lei wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-18 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 16:08 [for-5.20/block PATCH] mmc: fix disk/queue leak in case of adding disk failure Ming Lei
2022-07-18 19:13 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.