linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-04-01 13:09 Chen Zhou
  2020-05-27  4:15 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Zhou @ 2020-04-01 13:09 UTC (permalink / raw)
  To: paulus, benh, mpe; +Cc: kvm-ppc, linuxppc-dev, linux-kernel, chenzhou10

Free function kfree() already does NULL check, so the additional
check is unnecessary, just remove it.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 arch/powerpc/kvm/book3s_hv_nested.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c
index dc97e5b..cad3243 100644
--- a/arch/powerpc/kvm/book3s_hv_nested.c
+++ b/arch/powerpc/kvm/book3s_hv_nested.c
@@ -1416,8 +1416,7 @@ static long int __kvmhv_nested_page_fault(struct kvm_run *run,
 	rmapp = &memslot->arch.rmap[gfn - memslot->base_gfn];
 	ret = kvmppc_create_pte(kvm, gp->shadow_pgtable, pte, n_gpa, level,
 				mmu_seq, gp->shadow_lpid, rmapp, &n_rmap);
-	if (n_rmap)
-		kfree(n_rmap);
+	kfree(n_rmap);
 	if (ret == -EAGAIN)
 		ret = RESUME_GUEST;	/* Let the guest try again */
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
  2020-04-01 13:09 [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check Chen Zhou
@ 2020-05-27  4:15 ` Paul Mackerras
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2020-05-27  4:15 UTC (permalink / raw)
  To: Chen Zhou; +Cc: benh, mpe, kvm-ppc, linuxppc-dev, linux-kernel

On Wed, Apr 01, 2020 at 09:09:03PM +0800, Chen Zhou wrote:
> Free function kfree() already does NULL check, so the additional
> check is unnecessary, just remove it.
> 
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>

Thanks, applied to my kvm-ppc-next branch.

Paul.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27  4:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 13:09 [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check Chen Zhou
2020-05-27  4:15 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).