mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
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: e309fd113b ("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>
This commit is contained in:
parent
63804fed14
commit
1c0180cd42
1 changed files with 1 additions and 4 deletions
|
|
@ -494,12 +494,9 @@ int kvm_riscv_vcpu_pmu_event_info(struct kvm_vcpu *vcpu, unsigned long saddr_low
|
|||
}
|
||||
|
||||
ret = kvm_vcpu_write_guest(vcpu, shmem, einfo, shmem_size);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
ret = SBI_ERR_INVALID_ADDRESS;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
free_mem:
|
||||
kfree(einfo);
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue