]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/intc/arm_gicv5: Add missing early return in gicv5_set_handling()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 12 May 2026 09:38:56 +0000 (10:38 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 May 2026 08:47:22 +0000 (09:47 +0100)
In gicv5_set_handling(), if the guest tried to set the handling mode
on a nonexistent SPI then we print a GUEST_ERROR log message.
However, we forgot to then return, so execution continues into a NULL
pointer dereference.

Add the missing "return", bringing the code structure in to line with
the equivalent parts in other functions like gicv5_set_pending() and
gicv5_set_target().

CID: 1659596
Fixes: 5beb48ab53d ("hw/intc/arm_gicv5: Make gicv5_set_* update SPI state")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260512093856.3197700-5-peter.maydell@linaro.org

hw/intc/arm_gicv5.c

index 7ad274e36964e70ef9dbf7085de3ad7775c58470..6b1dd04991cd7e15064f84612ec43ef36689f472 100644 (file)
@@ -926,6 +926,7 @@ void gicv5_set_handling(GICv5Common *cs, uint32_t id,
         if (!spi) {
             qemu_log_mask(LOG_GUEST_ERROR, "gicv5_set_handling: tried to set "
                           "priority of unreachable SPI %d\n", id);
+            return;
         }
 
         spi->hm = handling;