Skip to content
Commit 21e87dae authored by Dan Carpenter's avatar Dan Carpenter Committed by Oliver Upton
Browse files

KVM: arm64: timers: Fix resource leaks in kvm_timer_hyp_init()



Smatch detected this bug:
    arch/arm64/kvm/arch_timer.c:1425 kvm_timer_hyp_init()
    warn: missing unwind goto?

There are two resources to be freed the vtimer and ptimer.  The
line that Smatch complains about should free the vtimer first
before returning and then after that cleanup code should free
the ptimer.

I've added a out_free_ptimer_irq to free the ptimer and renamed
the existing label to out_free_vtimer_irq.

Fixes: 9e01dc76 ("KVM: arm/arm64: arch_timer: Assign the phys timer on VHE systems")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/72fffc35-7669-40b1-9d14-113c43269cf3@kili.mountain


Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
parent b53d4a27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment