]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ
authorKrzysztof Kozlowski <krzk@kernel.org>
Fri, 4 Oct 2019 15:08:26 +0000 (17:08 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 16:03:50 +0000 (10:03 -0600)
BugLink: https://bugs.launchpad.net/bugs/1858429
[ Upstream commit 41814c4eadf8a791b6d07114f96e7e120e59555c ]

platform_get_irq_byname() might return -errno which later would be cast
to an unsigned int and used in IRQ handling code leading to usage of
wrong ID and errors about wrong irq_base.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Peng Ma <peng.ma@nxp.com>
Tested-by: Peng Ma <peng.ma@nxp.com>
Link: https://lore.kernel.org/r/20191004150826.6656-1-krzk@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/dma/fsl-qdma.c

index 06664fbd2d911638167f35ea06ea57bd0d2565f0..89792083d62c51749023dada82b34e48ab7c07c3 100644 (file)
@@ -1155,6 +1155,9 @@ static int fsl_qdma_probe(struct platform_device *pdev)
                return ret;
 
        fsl_qdma->irq_base = platform_get_irq_byname(pdev, "qdma-queue0");
+       if (fsl_qdma->irq_base < 0)
+               return fsl_qdma->irq_base;
+
        fsl_qdma->feature = of_property_read_bool(np, "big-endian");
        INIT_LIST_HEAD(&fsl_qdma->dma_dev.channels);