]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/mshv: use return value of handle_pio_str_read
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Oct 2025 12:54:30 +0000 (14:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 28 Oct 2025 13:50:07 +0000 (14:50 +0100)
Coverity complains because we assign to ret here but
then never read it again before we overwrite it with
the call to set_x64_registers().

Analyzed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/mshv/mshv-cpu.c

index 1f7b9cb37ec23bdf08015df52c45a71d1f76e2fc..1c3db02188c432061312cabcf9f1bba40fc812da 100644 (file)
@@ -1489,6 +1489,10 @@ static int handle_pio_str(CPUState *cpu, hv_x64_io_port_intercept_message *info)
         reg_values[0] = info->rsi;
     } else {
         ret = handle_pio_str_read(cpu, info, repeat, port, direction_flag);
+        if (ret < 0) {
+            error_report("Failed to handle pio str read");
+            return -1;
+        }
         reg_names[0] = HV_X64_REGISTER_RDI;
         reg_values[0] = info->rdi;
     }