aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Gang S <gang.chen@sunrus.com.cn>2015-01-25 08:00:42 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2015-02-10 09:27:20 +0300
commitdec0473dc683ac0ddd7946acdebd285728966a02 (patch)
tree6e7d73e4e67289591e9c78633b59c9e54fdc66dc
parenta86b3c64d45f2bf306fd4bf879abb4ac21d761f9 (diff)
downloadqemu-dec0473dc683ac0ddd7946acdebd285728966a02.zip
qemu-dec0473dc683ac0ddd7946acdebd285728966a02.tar.gz
qemu-dec0473dc683ac0ddd7946acdebd285728966a02.tar.bz2
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 <gang.chen.5i5j@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--linux-user/syscall.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 310080c..5720195 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;
}