Skip to content

Commit

Permalink
KVM: PPC: Memset vcpu to zeros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Graf authored and Avi Kivity committed Apr 25, 2010
1 parent a1efbe7 commit 7e821d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e821d3

Please sign in to comment.