projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73e77c0
)
KVM: PPC: e500mc: Fix a NULL dereference
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 13 Jul 2017 07:38:49 +0000
(10:38 +0300)
committer
Paul Mackerras
<paulus@ozlabs.org>
Thu, 31 Aug 2017 02:36:44 +0000
(12:36 +1000)
We should set "err = -ENOMEM;", otherwise it means we're returning
ERR_PTR(0) which is NULL. It results in a NULL pointer dereference in
the caller.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/e500mc.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/powerpc/kvm/e500mc.c
b/arch/powerpc/kvm/e500mc.c
index f48a0c22e8f9024e87965df7b0821596d43c926a..d0b6b5788afcff7b15f63fb80f9d2c0c3d656d3b 100644
(file)
--- a/
arch/powerpc/kvm/e500mc.c
+++ b/
arch/powerpc/kvm/e500mc.c
@@
-331,8
+331,10
@@
static struct kvm_vcpu *kvmppc_core_vcpu_create_e500mc(struct kvm *kvm,
goto uninit_vcpu;
vcpu->arch.shared = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
- if (!vcpu->arch.shared)
+ if (!vcpu->arch.shared) {
+ err = -ENOMEM;
goto uninit_tlb;
+ }
return vcpu;