KVM: arm: fix missing free_percpu_irq in kvm_timer_hyp_init()
Quoted 8 lines · Marc Zyngier
Quoted 5 lines · linmiaohe
From: Miaohe Lin <[email protected]>
When
host_ptimer_irqrequest irq resource failed, we forget to release thehost_vtimer_irqresource already requested.
Fix this missing irq release and other similar scenario.That's really not a big deal, as nothing but KVM can use the timers anyway, but I guess it doesn't hurt to be correct.
I think It's a good practice to release the never used resources though it may be harmless.
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +6
-1-out_free_irq: + +out_free_ptimer_irq: + free_percpu_irq(host_ptimer_irq, kvm_get_running_vcpus()); +out_disable_gic_state: + if (has_gic) + static_branch_disable(&has_gic_active_state);Given that we're failing the init of KVM, this is totally superfluous. Also, this state is still valid, no matter what happens (the GIC is not going away from under our feet).
Would you like a v2 patch without out_disable_gic_state cleanup ? If so, I would send a new one. But if you think this patch isn't worth to pick up, I would drop it.
Many thanks for your review.
Quoted 3 lines
Quoted 3 lines
(quoted diff) +2
-0+out_free_vtimer_irq: free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus()); +