1
0
Fork 0

KVM: PPC: Book 3S: Fix error return in kvm_vm_ioctl_create_spapr_tce()

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>
hifive-unleashed-5.1
Wei Yongjun 2017-02-08 16:20:01 +00:00 committed by Paul Mackerras
parent a4a741a048
commit 5982f0849e
1 changed files with 1 additions and 0 deletions

View File

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