]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: PPC: Memset vcpu to zeros
authorAlexander Graf <alex@csgraf.de>
Mon, 22 Feb 2010 15:52:08 +0000 (16:52 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Apr 2010 09:39:21 +0000 (12:39 +0300)
While converting the kzalloc we used to allocate our vcpu struct to
vmalloc, I forgot to memset the contents to zeros. That broke quite
a lot.

This patch memsets it to zero again.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/book3s.c

index 6758ec80f9024145f67619cca2ded61d735aa5df..8cab902771a2aaa82b26a13ba12e10907244c99c 100644 (file)
@@ -1117,6 +1117,7 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
                err = -ENOMEM;
                goto out;
        }
+       memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
 
        vcpu = &vcpu_book3s->vcpu;
        err = kvm_vcpu_init(vcpu, kvm, id);