From: Andres Lagar-Cavilla <andres@lagarcavilla.org>
To: xen-devel@lists.xen.org
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
David Vrabel <david.vrabel@citrix.com>,
Andres Lagar-Cavilla <andres@lagarcavilla.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH] Fix mmap batch ioctl error status copy back.
Date: Thu, 6 Sep 2012 13:24:39 -0400 [thread overview]
Message-ID: <1346952279-1068-1-git-send-email-andres@lagarcavilla.org> (raw)
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
reply other threads:[~2012-09-06 17:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346952279-1068-1-git-send-email-andres@lagarcavilla.org \
--to=andres@lagarcavilla.org \
--cc=andreslc@gridcentric.ca \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).