projects
/
platform
/
kernel
/
linux-rpi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KVM: x86: Gracefully handle __vmalloc() failure during VM allocation
[platform/kernel/linux-rpi.git]
/
arch
/
x86
/
kvm
/
vmx
/
vmx.c
diff --git
a/arch/x86/kvm/vmx/vmx.c
b/arch/x86/kvm/vmx/vmx.c
index
23f0879
..
e0d16ba
100644
(file)
--- a/
arch/x86/kvm/vmx/vmx.c
+++ b/
arch/x86/kvm/vmx/vmx.c
@@
-6654,6
+6654,10
@@
static struct kvm *vmx_vm_alloc(void)
struct kvm_vmx *kvm_vmx = __vmalloc(sizeof(struct kvm_vmx),
GFP_KERNEL_ACCOUNT | __GFP_ZERO,
PAGE_KERNEL);
struct kvm_vmx *kvm_vmx = __vmalloc(sizeof(struct kvm_vmx),
GFP_KERNEL_ACCOUNT | __GFP_ZERO,
PAGE_KERNEL);
+
+ if (!kvm_vmx)
+ return NULL;
+
return &kvm_vmx->kvm;
}
return &kvm_vmx->kvm;
}