Skip to content

Commit 32e594f

Browse files
Chen Zhoupaulusmack
authored andcommitted
KVM: PPC: Book3S HV: Remove redundant NULL check
Free function kfree() already does NULL check, so the additional check is unnecessary, just remove it. Signed-off-by: Chen Zhou <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 9d5272f commit 32e594f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/kvm/book3s_hv_nested.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,8 +1416,7 @@ static long int __kvmhv_nested_page_fault(struct kvm_run *run,
14161416
rmapp = &memslot->arch.rmap[gfn - memslot->base_gfn];
14171417
ret = kvmppc_create_pte(kvm, gp->shadow_pgtable, pte, n_gpa, level,
14181418
mmu_seq, gp->shadow_lpid, rmapp, &n_rmap);
1419-
if (n_rmap)
1420-
kfree(n_rmap);
1419+
kfree(n_rmap);
14211420
if (ret == -EAGAIN)
14221421
ret = RESUME_GUEST; /* Let the guest try again */
14231422

0 commit comments

Comments
 (0)