aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-07-18 21:21:47 -0400
committerVinod Koul <vinod.koul@intel.com>2014-07-22 12:08:43 -0400
commitb1e51d771fbc9fec15785760a2f725040a0fe671 (patch)
treee16653425118d99fb375d7d6209ecf1d624bcbb7
parentff4d02419ada5f2f174c646c58c5d07ddcf59de5 (diff)
dmaengine: pl330: Check if the DMA descriptor is NULL
Commit 6079d38 ("dmaengine: pl330: Remove useless xfer_cb indirection") removed the __callback() function which created an unnecessary level of indirection to execute the tranfer callback .xfer_cb Unfortunately the commit also changed the semantics slightly since that function used to check if the request was not NULL before attempting to execute the callback function. Not checking this could lead to a kernel NULL pointer dereference error. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/pl330.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index bc5878a5c09e..a55d75498098 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1441,9 +1441,14 @@ xfer_exit:
1441 1441
1442static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err) 1442static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err)
1443{ 1443{
1444 struct dma_pl330_chan *pch = desc->pchan; 1444 struct dma_pl330_chan *pch;
1445 unsigned long flags; 1445 unsigned long flags;
1446 1446
1447 if (!desc)
1448 return;
1449
1450 pch = desc->pchan;
1451
1447 /* If desc aborted */ 1452 /* If desc aborted */
1448 if (!pch) 1453 if (!pch)
1449 return; 1454 return;