Skip to content

Commit ec54c0a

Browse files
sergey-senozhatskystorulf
authored andcommitted
mtk-sd: reset host->mrq on prepare_data() error
Do not leave host with dangling ->mrq pointer if we hit the msdc_prepare_data() error out path. Signed-off-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Fixes: f5de469 ("mtk-sd: Prevent memory corruption from DMA map failure") Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent dcc3bcf commit ec54c0a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mmc/host/mtk-sd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,7 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
14921492
if (mrq->data) {
14931493
msdc_prepare_data(host, mrq->data);
14941494
if (!msdc_data_prepared(mrq->data)) {
1495+
host->mrq = NULL;
14951496
/*
14961497
* Failed to prepare DMA area, fail fast before
14971498
* starting any commands.

0 commit comments

Comments
 (0)