From: Kedareswara rao Appana Date: Thu, 7 Dec 2017 05:24:28 +0000 (+0530) Subject: dmaengine: zynqmp_dma: Fix race condition in the probe X-Git-Tag: v4.16-rc1~138^2^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ba080aada5e739165e0f38d5cc3b04c82b323c8;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index a297a26598480..f14645817ed80 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -851,7 +851,8 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan) if (!chan) 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); list_del(&chan->common.device_node); }