From: Peter Griffin Date: Tue, 7 Jun 2016 17:38:40 +0000 (+0100) Subject: dmaengine: tegra20-apb-dma: Only calculate residue if txstate exists. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=71f7e6cc5500;p=linux-beck.git dmaengine: tegra20-apb-dma: Only calculate residue if txstate exists. There is no point calculating the residue if there is no txstate to store the value. Signed-off-by: Peter Griffin Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 01e316f73559..7f4af8c5b9d6 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -814,7 +814,7 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc, unsigned int residual; ret = dma_cookie_status(dc, cookie, txstate); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !txstate) return ret; spin_lock_irqsave(&tdc->lock, flags);