From: Salil Mehta Date: Thu, 1 Aug 2024 09:15:03 +0000 (+0100) Subject: accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic X-Git-Tag: qemu-xen-4.20.0~38^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=036144cff27ef2f97de7ffc0c1150f3779b94d58;p=qemu-xen.git accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic 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 Signed-off-by: Salil Mehta Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Message-id: 20240725145132.99355-1-salil.mehta@huawei.com Suggested-by: Peter Maydell Message-ID: Signed-off-by: Salil Mehta Signed-off-by: Peter Maydell --- diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e1d1386306..75d11a07b2 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; } }