Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e9e4062 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Chris Ball
Browse files

mmc: atmel: don't test host->data



Found using smatch:
drivers/mmc/host/atmel-mci.c:827 atmci_pdc_complete() warn: variable
dereferenced before check 'host->data' (see line 807)

Stop testing host->data as it is not NULL at that point.

Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarChris Ball <chris@printf.net>
parent b677b885
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -820,17 +820,10 @@ static void atmci_pdc_complete(struct atmel_mci *host)

	atmci_pdc_cleanup(host);

	/*
	 * If the card was removed, data will be NULL. No point trying
	 * to send the stop command or waiting for NBUSY in this case.
	 */
	if (host->data) {
		dev_dbg(&host->pdev->dev,
		        "(%s) set pending xfer complete\n", __func__);
	dev_dbg(&host->pdev->dev, "(%s) set pending xfer complete\n", __func__);
	atmci_set_pending(host, EVENT_XFER_COMPLETE);
	tasklet_schedule(&host->tasklet);
}
}

static void atmci_dma_cleanup(struct atmel_mci *host)
{