Skip to content

Commit faded9b

Browse files
Wenchao Chenstorulf
authored andcommitted
mmc: sdhci: Fix host->cmd is null
When data crc occurs, the kernel will panic because host->cmd is null. Signed-off-by: Wenchao Chen <[email protected]> Fixes: efe8f5c ("mmc: sdhci: Capture eMMC and SD card errors") Cc: [email protected] Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 80e78fc commit faded9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ bool sdhci_cqe_irq(struct sdhci_host *host, u32 intmask, int *cmd_error,
39283928

39293929
if (intmask & (SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC)) {
39303930
*cmd_error = -EILSEQ;
3931-
if (!mmc_op_tuning(host->cmd->opcode))
3931+
if (!mmc_op_tuning(SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND))))
39323932
sdhci_err_stats_inc(host, CMD_CRC);
39333933
} else if (intmask & SDHCI_INT_TIMEOUT) {
39343934
*cmd_error = -ETIMEDOUT;
@@ -3938,7 +3938,7 @@ bool sdhci_cqe_irq(struct sdhci_host *host, u32 intmask, int *cmd_error,
39383938

39393939
if (intmask & (SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC)) {
39403940
*data_error = -EILSEQ;
3941-
if (!mmc_op_tuning(host->cmd->opcode))
3941+
if (!mmc_op_tuning(SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND))))
39423942
sdhci_err_stats_inc(host, DAT_CRC);
39433943
} else if (intmask & SDHCI_INT_DATA_TIMEOUT) {
39443944
*data_error = -ETIMEDOUT;

0 commit comments

Comments
 (0)