Patchwork [51/56] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages

login
register
mail settings
Submitter Alexander Graf
Date Oct. 4, 2012, 1:37 p.m.
Message ID <1349357844-11288-52-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/189145/
State New
Headers show

Comments

Alexander Graf - Oct. 4, 2012, 1:37 p.m.
From: Scott Wood <scottwood@freescale.com>

This was found by kmemleak.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/e500_tlb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index a27d134..641f978 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -1134,6 +1134,8 @@  static void free_gtlb(struct kvmppc_vcpu_e500 *vcpu_e500)
 		}
 
 		vcpu_e500->num_shared_tlb_pages = 0;
+
+		kfree(vcpu_e500->shared_tlb_pages);
 		vcpu_e500->shared_tlb_pages = NULL;
 	} else {
 		kfree(vcpu_e500->gtlb_arch);