From: Peter Griffin Date: Tue, 7 Jun 2016 17:38:39 +0000 (+0100) Subject: dmaengine: sun6i-dma: Only calculate residue if state exists. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9ab9d10d9898cd022fece44a474e5ddb785d639;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dmaengine: sun6i-dma: Only calculate residue if state exists. There is no point in calculating the residue if state does not exist to store the value. Signed-off-by: Peter Griffin Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index 5065ca43face..3835fcde3545 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -865,7 +865,7 @@ static enum dma_status sun6i_dma_tx_status(struct dma_chan *chan, size_t bytes = 0; ret = dma_cookie_status(chan, cookie, state); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !state) return ret; spin_lock_irqsave(&vchan->vc.lock, flags);