Skip to contentSkip to conversation

dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ

RFT Applied Krzysztof Kozlowski 3 participants 3 messages Oct 4, 2019 – Nov 2, 2019 dmaengine

lore
Share & tools
lore
#0 lore raw

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.

---

Not marking as cc-stable as this was not reproduced and not tested.

---
 drivers/dma/fsl-qdma.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma/fsl-qdma.c +3 -0
index 06664fbd2d91..89792083d62c 100644
@@ -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);
 
Signature · 1 line
2.17.1
Reviewed-by Tested-by
#1 lore raw

Hi Krzysztof,

Thanks for your patch.

Best Regards,
Peng

Quoted 42 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: 2019年10月4日 23:08
To: Vinod Koul <[email protected]>; Dan Williams <[email protected]>; Peng Ma <[email protected]>; Wen He <[email protected]>; Jiaheng Fan <[email protected]>; Krzysztof Kozlowski <[email protected]>; [email protected]; [email protected]
Subject: [EXT] [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ

Caution: EXT Email

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.

---

Not marking as cc-stable as this was not reproduced and not tested.
---
drivers/dma/fsl-qdma.c | 3 +++

1 file changed, 3 insertions(+)
drivers/dma/fsl-qdma.c index renamed from drivers/dma/fsl-qdma.c +0 -0

06664fbd2d91..89792083d62c 100644

drivers/dma/fsl-qdma.c +3 -0
@@ -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);

--
2.17.1

maintainer Applied
#2 lore raw
In reply to Krzysztof Kozlowski
Quoted 3 lines · Krzysztof Kozlowski

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.

Applied, thanks

Signature · 1 line
~Vinod