Skip to content

Commit

Permalink
KVM: PPC: Book 3S: Fix error return in kvm_vm_ioctl_create_spapr_tce()
Browse files Browse the repository at this point in the history
Fix to return error code -ENOMEM from the memory alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
  • Loading branch information
Wei Yongjun authored and Paul Mackerras committed Feb 9, 2017
1 parent a4a741a commit 5982f08
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_64_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
goto fail;
}

ret = -ENOMEM;
stt = kzalloc(sizeof(*stt) + npages * sizeof(struct page *),
GFP_KERNEL);
if (!stt)
Expand Down

0 comments on commit 5982f08

Please sign in to comment.