* [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-04-01 13:09 ` Chen Zhou
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-04-01 13:09 ` Chen Zhou
0 siblings, 0 replies; 6+ messages in thread
From: Chen Zhou @ 2020-04-01 13:09 UTC (permalink / raw)
To: paulus, benh, mpe; +Cc: chenzhou10, linuxppc-dev, linux-kernel, kvm-ppc
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] 6+ messages in thread
* [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-04-01 13:09 ` Chen Zhou
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
* Re: [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
2020-04-01 13:09 ` Chen Zhou
(?)
@ 2020-05-27 4:15 ` Paul Mackerras
-1 siblings, 0 replies; 6+ 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] 6+ messages in thread
* Re: [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-05-27 4:15 ` Paul Mackerras
0 siblings, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2020-05-27 4:15 UTC (permalink / raw)
To: Chen Zhou; +Cc: linuxppc-dev, linux-kernel, kvm-ppc
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] 6+ messages in thread
* Re: [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check
@ 2020-05-27 4:15 ` Paul Mackerras
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
end of thread, other threads:[~2020-05-27 4:32 UTC | newest]
Thread overview: 6+ 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-04-01 13:09 ` Chen Zhou
2020-04-01 13:09 ` Chen Zhou
2020-05-27 4:15 ` Paul Mackerras
2020-05-27 4:15 ` Paul Mackerras
2020-05-27 4:15 ` Paul Mackerras
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.