]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
hw/mips/loongson3_virt: Fix condition of IPI IOCSR connection
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Fri, 21 Jun 2024 13:11:14 +0000 (14:11 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 19 Aug 2024 22:28:24 +0000 (00:28 +0200)
>>>     CID 1547264:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "ipi" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Resolves: Coverity CID 1547264
Link: https://lore.kernel.org/qemu-devel/752417ad-ab72-4fed-8d1f-af41f15bc225@app.fastmail.com/
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240621-loongson3-ipi-follow-v2-2-848eafcbb67e@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/mips/loongson3_virt.c

index 27a85e3614a51cff7ad1e73781008a3186334e14..2067b4fecb5c597b6b11221baa4dc1a9c7488741 100644 (file)
@@ -574,7 +574,7 @@ static void mips_loongson3_virt_init(MachineState *machine)
         cpu_mips_clock_init(cpu);
         qemu_register_reset(main_cpu_reset, cpu);
 
-        if (ipi) {
+        if (!kvm_enabled()) {
             hwaddr base = ((hwaddr)node << 44) + virt_memmap[VIRT_IPI].base;
             base += core * 0x100;
             qdev_connect_gpio_out(ipi, i, cpu->env.irq[6]);