KVM: PPC: check for lookup_linux_ptep() returning NULL
Subsystems (3)
PATCH 1/1 KVM: PPC: check for lookup_linux_ptep() returning NULL
If passed a larger page size lookup_linux_ptep()
may fail, so add a check for that and bail out
if that's the case.
This was found with the help of a static
code analysis tool.
---
based on https://github.com/agraf/linux-2.6.git kvm-ppc-next
arch/powerpc/kvm/e500_mmu_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/e500_mmu_host.c +1 -1
@@ -469,7 +469,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, pgdir = vcpu_e500->vcpu.arch.pgdir; ptep =lookup_linux_ptep (pgdir, hva, &tsize_pages); -if (pte_present (*ptep)) +if (ptep &&pte_present (*ptep)) wimg = (*ptep >>PTE_WIMGE_SHIFT ) &MAS2_WIMGE_MASK ;else {if (printk_ratelimit ())
Signature · 1 line
1.8.3.1
Quoted 6 lines · Laurentiu Tudor
If passed a larger page size
lookup_linux_ptep()
may fail, so add a check for that and bail out
if that's the case.
This was found with the help of a static
code analysis tool.
Quoted 8 lines
Signed-off-by Mihai Caraman <[email protected]>Signed-off-by Laurentiu Tudor <[email protected]>Cc Scott Wood <[email protected]>---
based on https://github.com/agraf/linux-2.6.git kvm-ppc-nextarch/powerpc/kvm/e500_mmu_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
-Scott
Alexander Graf
AppliedQuoted 13 lines · Scott Wood
Quoted 12 lines · Laurentiu Tudor
If passed a larger page size
lookup_linux_ptep()
may fail, so add a check for that and bail out
if that's the case.
This was found with the help of a static
code analysis tool.Signed-off-by Mihai Caraman <[email protected]>Signed-off-by Laurentiu Tudor <[email protected]>Cc Scott Wood <[email protected]>---
based on https://github.com/agraf/linux-2.6.git kvm-ppc-next
Quoted 4 lines
Quoted 2 lines
arch/powerpc/kvm/e500_mmu_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Scott Wood <[email protected]>
Thanks, applied to kvm-ppc-queue.
Alex