[PATCH 3/6] irqdomain/msi: Fix return check of __irq_domain_alloc_irqs

Adam Lackorzynski adam at l4re.org
Sat Jan 2 12:58:56 EST 2021


0 is not a proper IRQ number and also indicates failure.

Signed-off-by: Adam Lackorzynski <adam at l4re.org>
---
 kernel/irq/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 2c0c4d6d0f83..e1fe832e7161 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -416,7 +416,7 @@ int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
 		virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used,
 					       dev_to_node(dev), &arg, false,
 					       desc->affinity);
-		if (virq < 0) {
+		if (virq <= 0) {
 			ret = -ENOSPC;
 			if (ops->handle_error)
 				ret = ops->handle_error(domain, desc, ret);
-- 
2.30.0.rc2




More information about the linux-arm-kernel mailing list