diff mbox

[2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages

Message ID 1345683864-10815-2-git-send-email-scottwood@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Scott Wood Aug. 23, 2012, 1:04 a.m. UTC
This was found by kmemleak.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kvm/e500_tlb.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Alexander Graf Sept. 25, 2012, 7:46 a.m. UTC | #1
On 23.08.2012, at 03:04, Scott Wood wrote:

> This was found by kmemleak.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Thanks, applied to kvm-ppc-next.


Alex

> ---
> arch/powerpc/kvm/e500_tlb.c |    2 ++
> 1 file changed, 2 insertions(+)
> 
> 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);
> -- 
> 1.7.9.5
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

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);