xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix mmap batch ioctl error status copy back.
@ 2012-09-06 17:24 Andres Lagar-Cavilla
  0 siblings, 0 replies; only message in thread
From: Andres Lagar-Cavilla @ 2012-09-06 17:24 UTC (permalink / raw)
  To: xen-devel
  Cc: Andres Lagar-Cavilla, David Vrabel, Andres Lagar-Cavilla,
	Konrad Rzeszutek Wilk

Copy back of per-slot error codes is only necessary for V2. V1 does not provide
an error array, so copyback will unconditionally set the global rc to EFAULT.
Only copyback for V2.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
---
 drivers/xen/privcmd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 5386f20..e4dfa3b 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -389,7 +389,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 		state.err      = err_array;
 		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
 					 &pagelist, mmap_return_errors_v1, &state);
-	} else
+	} else if (version == 2)
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 
     /* If we have not had any EFAULT-like global errors then set the global
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-06 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-06 17:24 [PATCH] Fix mmap batch ioctl error status copy back Andres Lagar-Cavilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).