]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen: Use vma_lookup() in privcmd_ioctl_mmap()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 8 Apr 2021 20:06:36 +0000 (16:06 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 26 Nov 2021 19:50:28 +0000 (14:50 -0500)
vma_lookup() walks the VMA tree for a specific value, find_vma() will
search the tree after walking to a specific value.  It is more efficient
to only walk to the requested value as this case requires the address to
equal the vm_start.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
drivers/xen/privcmd.c

index 3369734108af23724e728531ce4024ea752b7fbc..ad17166b0ef6b39f75e979a1da0533a7997bfefe 100644 (file)
@@ -282,7 +282,7 @@ static long privcmd_ioctl_mmap(struct file *file, void __user *udata)
                                                     struct page, lru);
                struct privcmd_mmap_entry *msg = page_address(page);
 
-               vma = find_vma(mm, msg->va);
+               vma = vma_lookup(mm, msg->va);
                rc = -EINVAL;
 
                if (!vma || (msg->va != vma->vm_start) || vma->vm_private_data)