Skip to content

Commit

Permalink
mtk-sd: reset host->mrq on prepare_data() error
Browse files Browse the repository at this point in the history
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 <senozhatsky@chromium.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Fixes: f5de469 ("mtk-sd: Prevent memory corruption from DMA map failure")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250625052106.584905-1-senozhatsky@chromium.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sergey Senozhatsky authored and Greg Kroah-Hartman committed Jul 10, 2025
1 parent 61cdd66 commit b935c1e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mmc/host/mtk-sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (mrq->data) {
msdc_prepare_data(host, mrq->data);
if (!msdc_data_prepared(mrq->data)) {
host->mrq = NULL;
/*
* Failed to prepare DMA area, fail fast before
* starting any commands.
Expand Down

0 comments on commit b935c1e

Please sign in to comment.