aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/gntdev.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 9be3e5e46d1f..3c8803feba26 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -312,17 +312,10 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages)
312 312
313 if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) { 313 if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
314 int pgno = (map->notify.addr >> PAGE_SHIFT); 314 int pgno = (map->notify.addr >> PAGE_SHIFT);
315 if (pgno >= offset && pgno < offset + pages && use_ptemod) { 315 if (pgno >= offset && pgno < offset + pages) {
316 void __user *tmp = (void __user *) 316 /* No need for kmap, pages are in lowmem */
317 map->vma->vm_start + map->notify.addr; 317 uint8_t *tmp = pfn_to_kaddr(page_to_pfn(map->pages[pgno]));
318 err = copy_to_user(tmp, &err, 1);
319 if (err)
320 return -EFAULT;
321 map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
322 } else if (pgno >= offset && pgno < offset + pages) {
323 uint8_t *tmp = kmap(map->pages[pgno]);
324 tmp[map->notify.addr & (PAGE_SIZE-1)] = 0; 318 tmp[map->notify.addr & (PAGE_SIZE-1)] = 0;
325 kunmap(map->pages[pgno]);
326 map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE; 319 map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
327 } 320 }
328 } 321 }