Commit f93576e1 authored by Dave Jones's avatar Dave Jones Committed by Konrad Rzeszutek Wilk

xen/pvh: Fix misplaced kfree from xlated_setup_gnttab_pages

Passing a freed 'pages' to free_xenballooned_pages will end badly
on kernels with slub debug enabled.

This looks out of place between the rc assign and the check, but
we do want to kfree pages regardless of which path we take.
Signed-off-by: default avatarDave Jones <davej@fedoraproject.org>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent bc1b0df5
...@@ -162,14 +162,15 @@ static int __init xlated_setup_gnttab_pages(void) ...@@ -162,14 +162,15 @@ static int __init xlated_setup_gnttab_pages(void)
rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames, rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames,
&xen_auto_xlat_grant_frames.vaddr); &xen_auto_xlat_grant_frames.vaddr);
kfree(pages);
if (rc) { if (rc) {
pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__, pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__,
nr_grant_frames, rc); nr_grant_frames, rc);
free_xenballooned_pages(nr_grant_frames, pages); free_xenballooned_pages(nr_grant_frames, pages);
kfree(pages);
kfree(pfns); kfree(pfns);
return rc; return rc;
} }
kfree(pages);
xen_auto_xlat_grant_frames.pfn = pfns; xen_auto_xlat_grant_frames.pfn = pfns;
xen_auto_xlat_grant_frames.count = nr_grant_frames; xen_auto_xlat_grant_frames.count = nr_grant_frames;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment