Skip to contentSkip to conversation

Fix mmap batch ioctl error status copy back.

PATCH New Andres Lagar-Cavilla 1 participant 1 message Sep 6, 2012 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix mmap batch ioctl error status copy back.

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.

---
 drivers/xen/privcmd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/privcmd.c +1 -1
index 5386f20..e4dfa3b 100644
@@ -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
Signature · 1 line
1.7.9.5