Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5982f084 authored by Wei Yongjun's avatar Wei Yongjun Committed by Paul Mackerras
Browse files

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
parent a4a741a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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)