Skip to contentSkip to conversation

hw/intc/grlib_irqmp: abort realize when ncpus value is out of range

PATCH In review Clément Chigot 3 participants 3 messages Mar 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/grlib_irqmp: abort realize when ncpus value is out of range

Even if the error is set, the build is not aborted when the ncpus value is wrong, the return is missing.

---
 hw/intc/grlib_irqmp.c | 1 +
 1 file changed, 1 insertion(+)
hw/intc/grlib_irqmp.c +1 -0
index 144b121d48..c6c51a349c 100644
@@ -356,6 +356,7 @@ static void grlib_irqmp_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "Invalid ncpus properties: "
                    "%u, must be 0 < ncpus =< %u.", irqmp->ncpus,
                    IRQMP_MAX_CPU);
+        return;
     }
 
     qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Clément Chigot

Even if the error is set, the build is not aborted when the ncpus value is wrong, the return is missing.

---
 hw/intc/grlib_irqmp.c | 1 +
 1 file changed, 1 insertion(+)
hw/intc/grlib_irqmp.c +0 -0
index 144b121d48..c6c51a349c 100644

hw/intc/grlib_irqmp.c static void grlib_irqmp_realize(DeviceState *dev, Error **errp) · line 362

Quoted 7 lines
hw/intc/grlib_irqmp.c +1 -0
@@ -356,6 +356,7 @@ static void grlib_irqmp_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "Invalid ncpus properties: "
                    "%u, must be 0 < ncpus =< %u.", irqmp->ncpus,
                    IRQMP_MAX_CPU);
+        return;
     }
 
     qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS);

thanks
-- PMM