[PATCH 2/2] mmc: v4.14: Kill the request if the queuedata has been removed

From: Raul E Rangel
Date: Wed May 08 2019 - 14:59:57 EST


No reason to even try processing the request if the queue is shutting
down.

Signed-off-by: Raul E Rangel <rrangel@xxxxxxxxxxxx>
---
This commit applies to v4.14.116.

This doesn't apply to 5.1 since mmc has been migrated to blk-mq.

drivers/mmc/core/queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 4bf1a9c6440b..28c9646a4de9 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -30,7 +30,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
{
struct mmc_queue *mq = q->queuedata;

- if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
+ if (!mq || mmc_card_removed(mq->card) || mmc_access_rpmb(mq))
return BLKPREP_KILL;

req->rq_flags |= RQF_DONTPREP;
--
2.21.0.1020.gf2820cf01a-goog