Skip to content

Commit 5982f08

Browse files
Wei Yongjunpaulusmack
authored andcommitted
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>
1 parent a4a741a commit 5982f08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/powerpc/kvm/book3s_64_vio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
171171
goto fail;
172172
}
173173

174+
ret = -ENOMEM;
174175
stt = kzalloc(sizeof(*stt) + npages * sizeof(struct page *),
175176
GFP_KERNEL);
176177
if (!stt)

0 commit comments

Comments
 (0)