diff mbox

[PULL,11/26] linux-user: Fix incorrect use of host errno in do_ioctl_dm()

Message ID f9757b1d9649cb739ecf544c7137c0885281f6e8.1474546244.git.riku.voipio@linaro.org
State Accepted
Commit f9757b1d9649cb739ecf544c7137c0885281f6e8
Headers show

Commit Message

Riku Voipio Sept. 22, 2016, 12:13 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>


do_ioctl_dm() should return target errno values, not host ones;
correct an accidental use of a host errno in an error path.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.1.4
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efcc17a..e286907 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5001,7 +5001,7 @@  static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
 
     guest_data = arg + host_dm->data_start;
     if ((guest_data - arg) < 0) {
-        ret = -EINVAL;
+        ret = -TARGET_EINVAL;
         goto out;
     }
     guest_data_size = host_dm->data_size - host_dm->data_start;