On Thu, 25 Jul 2024 15:51:32 +0100
Salil Mehta <[email protected]> wrote:
> Loop should exit prematurely on successfully finding out the parked vCPU
> (struct
> KVMParkedVcpu) in the 'struct KVMState' maintained 'kvm_parked_vcpus' list of
> parked vCPUs.
>
> Fixes: Coverity CID 1558552
> Fixes: 08c3286822 ("accel/kvm: Extract common KVM vCPU {creation,parking}
> code")
> Reported-by: Peter Maydell <[email protected]>
> Suggested-by: Peter Maydell <[email protected]>
> Message-ID:
> <cafeaca-3_d1c7xsxwkfubd-lsw5c5i95e6xxv09r2c9ygtz...@mail.gmail.com>
> Signed-off-by: Salil Mehta <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
> ---
> accel/kvm/kvm-all.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 0aa4b4624a..c181297f00 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -362,6 +362,7 @@ int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
> QLIST_REMOVE(cpu, node);
> kvm_fd = cpu->kvm_fd;
> g_free(cpu);
> + break;
> }
> }
>