diff options
author | Erik Gilling <konkers@android.com> | 2010-09-08 18:16:45 -0700 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2010-10-25 16:57:46 -0700 |
commit | f41649e040b1f63e809fb2adb78ed2f3c3ebbcd0 (patch) | |
tree | 1386191824282de175fa5453907ea1a8bb08bfa4 | |
parent | 0c03a1dd5bd8a37932ae1d519156172affef22fd (diff) | |
download | op-kernel-dev-f41649e040b1f63e809fb2adb78ed2f3c3ebbcd0.zip op-kernel-dev-f41649e040b1f63e809fb2adb78ed2f3c3ebbcd0.tar.gz |
spi: tegra: fix error setting on timeout
avoids derefencing an uninitialized pointer
Change-Id: Icf528441ae481e9f6f5ddc0be32c7c217fa49701
Signed-off-by: Erik Gilling <konkers@android.com>
-rw-r--r-- | drivers/spi/spi_tegra.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi_tegra.c b/drivers/spi/spi_tegra.c index 0385fde..bb7df02 100644 --- a/drivers/spi/spi_tegra.c +++ b/drivers/spi/spi_tegra.c @@ -338,15 +338,15 @@ static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req) spin_lock_irqsave(&tspi->lock, flags); - if (timeout >= 1000) - m->status = -EIO; - val = spi_tegra_readl(tspi, SLINK_STATUS); val |= SLINK_RDY; spi_tegra_writel(tspi, val, SLINK_STATUS); - m = list_first_entry(&tspi->queue, struct spi_message, queue); + + if (timeout >= 1000) + m->status = -EIO; + spi = m->state; tspi->cur_pos += spi_tegra_drain_rx_fifo(tspi, tspi->cur); |