mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
KVM: PPC: e500mc: Fix a NULL dereference
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
parent
73e77c0982
commit
50a1a25987
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue