From 3945978a5548887be6015fbc2358f173093f97c2 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Mon, 11 Jan 2016 17:42:44 +0800 Subject: [PATCH] MLK-12188 dmaengine: fsl-edma: add fsl_chan->edesc NULL check Add fsl_chan->edesc NULL when calling .fsl_edma_desc_residue() to avoid NULL pointer access. Signed-off-by: Fugang Duan --- drivers/dma/fsl-edma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index c7568869284e..34a7bf69e026 100644 --- a/drivers/dma/fsl-edma.c +++ b/drivers/dma/fsl-edma.c @@ -426,7 +426,7 @@ static enum dma_status fsl_edma_tx_status(struct dma_chan *chan, vdesc = vchan_find_desc(&fsl_chan->vchan, cookie); if (fsl_chan->edesc && cookie == fsl_chan->edesc->vdesc.tx.cookie) txstate->residue = fsl_edma_desc_residue(fsl_chan, vdesc, true); - else if (vdesc) + else if (fsl_chan->edesc && vdesc) txstate->residue = fsl_edma_desc_residue(fsl_chan, vdesc, false); else txstate->residue = 0; -- 2.17.1