]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
dmaengine: zynqmp_dma: Fix race condition in the probe
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Thu, 7 Dec 2017 05:24:28 +0000 (10:54 +0530)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 26 Mar 2018 12:16:23 +0000 (09:16 -0300)
BugLink: http://bugs.launchpad.net/bugs/1758886
[ Upstream commit 5ba080aada5e739165e0f38d5cc3b04c82b323c8 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/dma/xilinx/zynqmp_dma.c

index 1ee1241ca79763307f3da5ba53873dc21044d9c9..5cc8ed31f26b2b9bf395d36332b9d7d76c070b8f 100644 (file)
@@ -838,7 +838,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);
        clk_disable_unprepare(chan->clk_apb);