Skip to content

Commit 339e3eb

Browse files
cloehlestorulf
authored andcommitted
mmc: queue: Cancel recovery work on cleanup
To prevent any recovery work running after the queue cleanup cancel it. Any recovery running post-cleanup dereferenced mq->card as NULL and was not meaningful to begin with. Cc: [email protected] Signed-off-by: Christian Loehle <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 406e148 commit 339e3eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/mmc/core/queue.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
493493
if (blk_queue_quiesced(q))
494494
blk_mq_unquiesce_queue(q);
495495

496+
/*
497+
* If the recovery completes the last (and only remaining) request in
498+
* the queue, and the card has been removed, we could end up here with
499+
* the recovery not quite finished yet, so cancel it.
500+
*/
501+
cancel_work_sync(&mq->recovery_work);
502+
496503
blk_mq_free_tag_set(&mq->tag_set);
497504

498505
/*

0 commit comments

Comments
 (0)