Skip to content

Commit a5804e5

Browse files
committed
mmc: sdhci: Avoid a NULL pointer crash
Two days into running a reboot test over the weekend, the SDHCI driver hit a NULL pointer in sdhci_needs_reset. It's not clear how that has been added by the changes for a faster reboot, but guard against it explicitly. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 0c7e4a4 commit a5804e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: drivers/mmc/host/sdhci.c

+2
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
14901490

14911491
static bool sdhci_needs_reset(struct sdhci_host *host, struct mmc_request *mrq)
14921492
{
1493+
if (!mrq)
1494+
return false;
14931495
return (!(host->flags & SDHCI_DEVICE_DEAD) &&
14941496
((mrq->cmd && mrq->cmd->error) ||
14951497
(mrq->sbc && mrq->sbc->error) ||

0 commit comments

Comments
 (0)