From: Dave Jones <davej@redhat.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
boris.ostrovsky@oracle.com, david.vrabel@citrix.com,
xen-devel@lists.xensource.com
Subject: Re: Fix misplaced kfree from xlated_setup_gnttab_pages
Date: Fri, 24 Jan 2014 13:48:57 -0500 [thread overview]
Message-ID: <20140124184857.GA5062@redhat.com> (raw)
In-Reply-To: <20140124184655.GC16410@phenom.dumpdata.com>
On Fri, Jan 24, 2014 at 01:46:55PM -0500, Konrad Rzeszutek Wilk wrote:
> Actually it should also be freed on the success path, as so:
>
> I can squash it in, if you are OK with that?
Looks good to me.
thanks,
Dave
> diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c
> index 103c93f..c985835 100644
> --- a/arch/x86/xen/grant-table.c
> +++ b/arch/x86/xen/grant-table.c
> @@ -162,14 +162,15 @@ static int __init xlated_setup_gnttab_pages(void)
> rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames,
> &xen_auto_xlat_grant_frames.vaddr);
>
> - kfree(pages);
> if (rc) {
> pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__,
> nr_grant_frames, rc);
> free_xenballooned_pages(nr_grant_frames, pages);
> + kfree(pages);
> kfree(pfns);
> return rc;
> }
> + kfree(pages);
>
> xen_auto_xlat_grant_frames.pfn = pfns;
> xen_auto_xlat_grant_frames.count = nr_grant_frames;
prev parent reply other threads:[~2014-01-24 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140123064242.09E68660D05@gitolite.kernel.org>
2014-01-24 18:31 ` Fix misplaced kfree from xlated_setup_gnttab_pages Dave Jones
2014-01-24 18:46 ` Konrad Rzeszutek Wilk
2014-01-24 18:48 ` Dave Jones [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=20140124184857.GA5062@redhat.com \
--to=davej@redhat.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.com \
/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