Merge tag 'mmc-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[muen/linux.git] / drivers / mmc / core / block.c
index 758657e4a85edaf30878693a6199c2b27878b71f..9e923cd1d80ebee9c96d70aceabb87b2a0935581 100644 (file)
@@ -2659,7 +2659,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) &&
@@ -2669,6 +2668,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);
        }
 }