From: Kangjie Lu Date: Mon, 11 Mar 2019 05:53:33 +0000 (-0500) Subject: mmc_spi: add a status check for spi_sync_locked X-Git-Tag: android-x86-8.1-r2~1^2~7^2~113 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=fa291e89997a27b0b34b9302ec8a8bf925dcecf2;p=android-x86%2Fkernel.git mmc_spi: add a status check for spi_sync_locked [ Upstream commit 611025983b7976df0183390a63a2166411d177f1 ] In case spi_sync_locked fails, the fix reports the error and returns the error code upstream. Signed-off-by: Kangjie Lu Reviewed-by: Laurent Pinchart Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 67f6bd24a9d0..ea254d00541f 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t, } status = spi_sync_locked(spi, &host->m); + if (status < 0) { + dev_dbg(&spi->dev, "read error %d\n", status); + return status; + } if (host->dma_dev) { dma_sync_single_for_cpu(host->dma_dev,