diff options
Diffstat (limited to 'drivers/mmc/core/block.c')
-rw-r--r-- | drivers/mmc/core/block.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 74882fa0f86d..90e1bcd03b46 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2442,9 +2442,14 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, /* used in ->open, must be set before add_disk: */ if (area_type == MMC_BLK_DATA_AREA_MAIN) dev_set_drvdata(&card->dev, md); - device_add_disk(md->parent, md->disk, mmc_disk_attr_groups); + ret = device_add_disk(md->parent, md->disk, mmc_disk_attr_groups); + if (ret) + goto err_cleanup_queue; return md; + err_cleanup_queue: + blk_cleanup_queue(md->disk->queue); + blk_mq_free_tag_set(&md->queue.tag_set); err_kfree: kfree(md); out: |