From: Zhouyi Zhou Date: Mon, 2 Dec 2013 10:21:58 +0000 (+0800) Subject: KVM: PPC: NULL return of kvmppc_mmu_hpte_cache_next should be handled X-Git-Tag: v3.14-rc1~26^2^2~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=47d45d9f53a7c478fc83dff7b421cb4bc3ad9f94;p=karo-tx-linux.git KVM: PPC: NULL return of kvmppc_mmu_hpte_cache_next should be handled NULL return of kvmppc_mmu_hpte_cache_next should be handled Signed-off-by: Zhouyi Zhou Signed-off-by: Alexander Graf --- diff --git a/arch/powerpc/kvm/book3s_32_mmu_host.c b/arch/powerpc/kvm/book3s_32_mmu_host.c index 3a0abd2e5a15..5fac89dfe4cd 100644 --- a/arch/powerpc/kvm/book3s_32_mmu_host.c +++ b/arch/powerpc/kvm/book3s_32_mmu_host.c @@ -243,6 +243,11 @@ next_pteg: /* Now tell our Shadow PTE code about the new page */ pte = kvmppc_mmu_hpte_cache_next(vcpu); + if (!pte) { + kvm_release_pfn_clean(hpaddr >> PAGE_SHIFT); + r = -EAGAIN; + goto out; + } dprintk_mmu("KVM: %c%c Map 0x%llx: [%lx] 0x%llx (0x%llx) -> %lx\n", orig_pte->may_write ? 'w' : '-',