Browse Source

dmaengine: zynqmp_dma: Fix race condition in the probe

Incase of interrupt property is not present,
Driver is trying to free an invalid irq,
This patch fixes it by adding a check before freeing the irq.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Kedareswara rao Appana 7 years ago
parent
commit
5ba080aada
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/dma/xilinx/zynqmp_dma.c

+ 2 - 1
drivers/dma/xilinx/zynqmp_dma.c

@@ -851,7 +851,8 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan)
 	if (!chan)
 	if (!chan)
 		return;
 		return;
 
 
-	devm_free_irq(chan->zdev->dev, chan->irq, chan);
+	if (chan->irq)
+		devm_free_irq(chan->zdev->dev, chan->irq, chan);
 	tasklet_kill(&chan->tasklet);
 	tasklet_kill(&chan->tasklet);
 	list_del(&chan->common.device_node);
 	list_del(&chan->common.device_node);
 }
 }