diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 20135a5de748..c895bb0d5569 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2647,7 +2647,6 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md) * from being accepted. */ card = md->queue.card; - mmc_cleanup_queue(&md->queue); if (md->disk->flags & GENHD_FL_UP) { device_remove_file(disk_to_dev(md->disk), &md->force_ro); if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) && @@ -2657,6 +2656,7 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md) del_gendisk(md->disk); } + mmc_cleanup_queue(&md->queue); mmc_blk_put(md); } }