From dec0473dc683ac0ddd7946acdebd285728966a02 Mon Sep 17 00:00:00 2001 From: Chen Gang S Date: Sun, 25 Jan 2015 08:00:42 +0800 Subject: [PATCH] linux-user/syscall.c: do_ioctl_dm: Need to call unlock_user() before going to failure return in default case In abi_long do_ioctl_dm(), after lock_user() call, the code does not call unlock_user() before going to failure return in default case. Signed-off-by: Chen Gang Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 310080c0c9..5720195654 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3576,6 +3576,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, } default: ret = -TARGET_EINVAL; + unlock_user(argptr, guest_data, 0); goto out; } unlock_user(argptr, guest_data, 0); @@ -3695,6 +3696,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, break; } default: + unlock_user(argptr, guest_data, 0); ret = -TARGET_EINVAL; goto out; }