summaryrefslogtreecommitdiffstats
path: root/drivers/xen/pvcalls-front.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-05-24 13:46:30 +0200
committerJuergen Gross <jgross@suse.com>2022-05-27 11:05:29 +0200
commit49f8b459fc1de5e3712b57c8ccefae9ec45270f8 (patch)
treea94aa459860a3d82cae0933e922e1cbfaa980766 /drivers/xen/pvcalls-front.c
parentxen: add support for initializing xenstore later as HVM domain (diff)
downloadlinux-49f8b459fc1de5e3712b57c8ccefae9ec45270f8.tar.xz
linux-49f8b459fc1de5e3712b57c8ccefae9ec45270f8.zip
xen: switch gnttab_end_foreign_access() to take a struct page pointer
Instead of a virtual kernel address use a pointer of the associated struct page as second parameter of gnttab_end_foreign_access(). Most users have that pointer available already and are creating the virtual address from it, risking problems in case the memory is located in highmem. gnttab_end_foreign_access() itself won't need to get the struct page from the address again. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/pvcalls-front.c')
-rw-r--r--drivers/xen/pvcalls-front.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index e254ed19488f..1826e8e67125 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -238,8 +238,8 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
spin_unlock(&bedata->socket_lock);
for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
- gnttab_end_foreign_access(map->active.ring->ref[i], 0);
- gnttab_end_foreign_access(map->active.ref, 0);
+ gnttab_end_foreign_access(map->active.ring->ref[i], NULL);
+ gnttab_end_foreign_access(map->active.ref, NULL);
free_page((unsigned long)map->active.ring);
kfree(map);
@@ -1117,7 +1117,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
}
}
if (bedata->ref != -1)
- gnttab_end_foreign_access(bedata->ref, 0);
+ gnttab_end_foreign_access(bedata->ref, NULL);
kfree(bedata->ring.sring);
kfree(bedata);
xenbus_switch_state(dev, XenbusStateClosed);