Skip to content

Commit

Permalink
mmc: queue: Cancel recovery work on cleanup
Browse files Browse the repository at this point in the history
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: stable@vger.kernel.org
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/c865c0c9789d428494b67b820a78923e@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Christian Löhle authored and Ulf Hansson committed Oct 17, 2022
1 parent 406e148 commit 339e3eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mmc/core/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
if (blk_queue_quiesced(q))
blk_mq_unquiesce_queue(q);

/*
* If the recovery completes the last (and only remaining) request in
* the queue, and the card has been removed, we could end up here with
* the recovery not quite finished yet, so cancel it.
*/
cancel_work_sync(&mq->recovery_work);

blk_mq_free_tag_set(&mq->tag_set);

/*
Expand Down

0 comments on commit 339e3eb

Please sign in to comment.