Skip to content
Commit 68fa965d authored by Mats Petersson's avatar Mats Petersson Committed by Konrad Rzeszutek Wilk
Browse files

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: default avatarMats Petersson <mats.petersson@citrix.com>
Acked-by: default avatarAndres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent ab277bbf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment