From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: Thomas Meyer <thomas@m3y3r.de>,
paulus@ozlabs.org, benh@kernel.crashing.org, mpe@ellerman.id.au,
kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Book3S HV: NULL check before some freeing functions is not needed.
Date: Mon, 03 Dec 2018 11:06:50 +1100 [thread overview]
Message-ID: <1543795610.7535.2.camel@gmail.com> (raw)
In-Reply-To: <1543760930051-2094322096-1-diffsplit-thomas@m3y3r.de>
On Sun, 2018-12-02 at 21:52 +0100, Thomas Meyer wrote:
> NULL check before some freeing functions is not needed.
Technically true, however I think a comment should be added then to
make it clearer to someone reading the code why this is ok.
See below.
Suraj.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
>
> diff -u -p a/arch/powerpc/kvm/book3s_hv_nested.c
> b/arch/powerpc/kvm/book3s_hv_nested.c
> --- a/arch/powerpc/kvm/book3s_hv_nested.c
> +++ b/arch/powerpc/kvm/book3s_hv_nested.c
> @@ -1252,8 +1252,7 @@ static long int __kvmhv_nested_page_faul
> 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);
e.g.
/* n_rmap set to NULL in kvmppc_create_pte if reference preserved */
> if (ret == -EAGAIN)
> ret = RESUME_GUEST; /* Let the guest try
> again */
>
prev parent reply other threads:[~2018-12-03 0:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1543760930050-1499171309-0-diffsplit-thomas@m3y3r.de>
2018-12-02 20:52 ` [PATCH] KVM: PPC: Book3S HV: NULL check before some freeing functions is not needed Thomas Meyer
2018-12-03 0:06 ` Suraj Jitindar Singh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1543795610.7535.2.camel@gmail.com \
--to=sjitindarsingh@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@ozlabs.org \
--cc=thomas@m3y3r.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).