Patchwork [50/56] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map

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

Comments

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

We were only allocating half the bytes we need, which was made more
obvious by a recent fix to the memset in  clear_tlb1_bitmap().

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

Patch

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index 43489a8..a27d134 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -1385,7 +1385,7 @@  int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500)
 	if (!vcpu_e500->gtlb_priv[1])
 		goto err;
 
-	vcpu_e500->g2h_tlb1_map = kzalloc(sizeof(unsigned int) *
+	vcpu_e500->g2h_tlb1_map = kzalloc(sizeof(u64) *
 					  vcpu_e500->gtlb_params[1].entries,
 					  GFP_KERNEL);
 	if (!vcpu_e500->g2h_tlb1_map)