]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/privcmd: Correctly return success from IOCTL_PRIVCMD_MMAPBATCH
authorMats Petersson <mats.petersson@citrix.com>
Fri, 16 Nov 2012 18:36:49 +0000 (18:36 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 4 Dec 2012 17:32:47 +0000 (12:32 -0500)
commit5ea6804977682d6940620be057cd0f4df662fe2e
tree451bbf1de6fedc0e63c4624d4b0b591091c86091
parent72482312eaa957108e8d68ec3683a9011dc83353
xen/privcmd: Correctly return success from IOCTL_PRIVCMD_MMAPBATCH

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Now also including Andres "move the ret = -EINVAL into the error handling
path, as this avoids other similar errors in future.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 68fa965dd923177eafad49b7a0045fc610917341)
drivers/xen/privcmd.c