Skip to content

Commit ca40e57

Browse files
sergey-senozhatskygregkh
authored andcommitted
mtk-sd: reset host->mrq on prepare_data() error
commit ec54c0a upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3419bc6 commit ca40e57

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
@@ -1354,6 +1354,7 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
13541354
if (mrq->data) {
13551355
msdc_prepare_data(host, mrq->data);
13561356
if (!msdc_data_prepared(mrq->data)) {
1357+
host->mrq = NULL;
13571358
/*
13581359
* Failed to prepare DMA area, fail fast before
13591360
* starting any commands.

0 commit comments

Comments
 (0)