diff options
-rw-r--r-- | arch/x86/xen/grant-table.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c index c0413046483a..1580e7a5a4cf 100644 --- a/arch/x86/xen/grant-table.c +++ b/arch/x86/xen/grant-table.c | |||
@@ -118,6 +118,7 @@ static int __init xlated_setup_gnttab_pages(void) | |||
118 | { | 118 | { |
119 | struct page **pages; | 119 | struct page **pages; |
120 | xen_pfn_t *pfns; | 120 | xen_pfn_t *pfns; |
121 | void *vaddr; | ||
121 | int rc; | 122 | int rc; |
122 | unsigned int i; | 123 | unsigned int i; |
123 | unsigned long nr_grant_frames = gnttab_max_grant_frames(); | 124 | unsigned long nr_grant_frames = gnttab_max_grant_frames(); |
@@ -143,21 +144,20 @@ static int __init xlated_setup_gnttab_pages(void) | |||
143 | for (i = 0; i < nr_grant_frames; i++) | 144 | for (i = 0; i < nr_grant_frames; i++) |
144 | pfns[i] = page_to_pfn(pages[i]); | 145 | pfns[i] = page_to_pfn(pages[i]); |
145 | 146 | ||
146 | rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames, | 147 | vaddr = vmap(pages, nr_grant_frames, 0, PAGE_KERNEL); |
147 | &xen_auto_xlat_grant_frames.vaddr); | 148 | if (!vaddr) { |
148 | |||
149 | if (rc) { | ||
150 | pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__, | 149 | pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__, |
151 | nr_grant_frames, rc); | 150 | nr_grant_frames, rc); |
152 | free_xenballooned_pages(nr_grant_frames, pages); | 151 | free_xenballooned_pages(nr_grant_frames, pages); |
153 | kfree(pages); | 152 | kfree(pages); |
154 | kfree(pfns); | 153 | kfree(pfns); |
155 | return rc; | 154 | return -ENOMEM; |
156 | } | 155 | } |
157 | kfree(pages); | 156 | kfree(pages); |
158 | 157 | ||
159 | xen_auto_xlat_grant_frames.pfn = pfns; | 158 | xen_auto_xlat_grant_frames.pfn = pfns; |
160 | xen_auto_xlat_grant_frames.count = nr_grant_frames; | 159 | xen_auto_xlat_grant_frames.count = nr_grant_frames; |
160 | xen_auto_xlat_grant_frames.vaddr = vaddr; | ||
161 | 161 | ||
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |