diff mbox series

dmaengine: moxart: handle irq_of_parse_and_map() errors

Message ID 20240716011518.3957126-1-make24@iscas.ac.cn (mailing list archive)
State Superseded
Headers show
Series dmaengine: moxart: handle irq_of_parse_and_map() errors | expand

Commit Message

Ma Ke July 16, 2024, 1:15 a.m. UTC
Zero and negative number is not a valid IRQ for in-kernel code and the
irq_of_parse_and_map() function returns zero on error.  So this check for
valid IRQs should only accept values > 0.

Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
 drivers/dma/moxart-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
index c48d68cbff92..0690ccab431d 100644
--- a/drivers/dma/moxart-dma.c
+++ b/drivers/dma/moxart-dma.c
@@ -573,7 +573,7 @@  static int moxart_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	irq = irq_of_parse_and_map(node, 0);
-	if (!irq) {
+	if (irq <= 0) {
 		dev_err(dev, "no IRQ resource\n");
 		return -EINVAL;
 	}