Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RISC-V: KVM: Remove unnecessary 'ret' assignment

If execution reaches "ret = 0" assignment in
kvm_riscv_vcpu_pmu_event_info() then it means
kvm_vcpu_write_guest() returned 0 hence ret is
already zero and does not need to be assigned 0.

Fixes: e309fd113b9f ("RISC-V: KVM: Implement get event info function")
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20251229072530.3075496-1-maqianga@uniontech.com
Signed-off-by: Anup Patel <anup@brainfault.org>

authored by

Qiang Ma and committed by
Anup Patel
1c0180cd 63804fed

+1 -4
+1 -4
arch/riscv/kvm/vcpu_pmu.c
··· 494 494 } 495 495 496 496 ret = kvm_vcpu_write_guest(vcpu, shmem, einfo, shmem_size); 497 - if (ret) { 497 + if (ret) 498 498 ret = SBI_ERR_INVALID_ADDRESS; 499 - goto free_mem; 500 - } 501 499 502 - ret = 0; 503 500 free_mem: 504 501 kfree(einfo); 505 502 out: