[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/3] Small fix-ups for the xen/privcmd ioctls
In implementing the mmap_batch_v2 ioctl, some of the feedback included small fixups that were also relevant to the existing mmap_batch ioctl. Prior to the mmap_batch_v2 patch, this adds those small fixups to the existing code. The const addition for gather_array is necessary for the implementation of mmap_batch_v2 and does not affect correctness. Signed-off-by: Adin Scannell <adin@xxxxxxxxxxx> --- drivers/xen/privcmd.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index ccee0f1..161681f 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -76,7 +76,7 @@ static void free_page_list(struct list_head *pages) */ static int gather_array(struct list_head *pagelist, unsigned nelem, size_t size, - void __user *data) + const void __user *data) { unsigned pageidx; void *pagedata; @@ -246,7 +246,7 @@ struct mmap_batch_state { domid_t domain; unsigned long va; struct vm_area_struct *vma; - int err; + unsigned long err; xen_pfn_t __user *user; }; @@ -256,6 +256,8 @@ static int mmap_batch_fn(void *data, void *state) xen_pfn_t *mfnp = data; struct mmap_batch_state *st = state; + BUG_ON(st == NULL || st->vma == NULL); + if (xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1, st->vma->vm_page_prot, st->domain) < 0) { *mfnp |= 0xf0000000U; -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |