[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140124184857.GA5062@redhat.com>
Date: Fri, 24 Jan 2014 13:48:57 -0500
From: Dave Jones <davej@...hat.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
boris.ostrovsky@...cle.com, david.vrabel@...rix.com,
xen-devel@...ts.xensource.com
Subject: Re: Fix misplaced kfree from xlated_setup_gnttab_pages
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists