KVM: PPC: fix couple of memory leaks in MPIC/XICS devices
Subsystems (3)
PATCH 1/1 KVM: PPC: fix couple of memory leaks in MPIC/XICS devices
XICS failed to free xics structure on error path. MPIC destroy handler forgot to delete kvm_device structure.
Signed-off-by Gleb Natapov <[email protected]>
---
Be warned that this is not even compiled tested.
arch/powerpc/kvm/book3s_xics.c +3 -1
@@ -1244,8 +1244,10 @@ static int kvmppc_xics_create(struct kvm_device *dev, u32 type) kvm->arch.xics = xics;mutex_unlock (&kvm->lock); -if (ret) +if (ret) { +kfree (xics);return ret; + }xics_debugfs_init (xics);
arch/powerpc/kvm/mpic.c +1 -0
@@ -1635,6 +1635,7 @@ static void mpic_destroy(struct kvm_device *dev) dev->kvm->arch.mpic =NULL ;kfree (opp); +kfree (dev); }static int mpic_set_default_irq_routing (struct openpic *opp)
--
Gleb.
Quoted 4 lines · Gleb Natapov
XICS failed to free xics structure on error path. MPIC destroy handler forgot to delete
kvm_devicestructure.Signed-off-by Gleb Natapov <[email protected]>
Paul, please ack :).
Alex
Quoted 4 lines · Gleb Natapov
XICS failed to free xics structure on error path. MPIC destroy handler forgot to delete
kvm_devicestructure.Signed-off-by Gleb Natapov <[email protected]>
Acked-by Paul Mackerras <[email protected]>
Alexander Graf
AppliedQuoted 7 lines · Paul Mackerras
Quoted 4 lines · Gleb Natapov
XICS failed to free xics structure on error path. MPIC destroy handler forgot to delete
kvm_devicestructure.Signed-off-by Gleb Natapov <[email protected]>Acked-by Paul Mackerras <[email protected]>
Thanks, applied to kvm-ppc-queue.
Alex