提交 dec0473d 编写于 作者: C Chen Gang S 提交者: Michael Tokarev

linux-user/syscall.c: do_ioctl_dm: Need to call unlock_user() before going to...

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: NChen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 a86b3c64
...@@ -3576,6 +3576,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, ...@@ -3576,6 +3576,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
} }
default: default:
ret = -TARGET_EINVAL; ret = -TARGET_EINVAL;
unlock_user(argptr, guest_data, 0);
goto out; goto out;
} }
unlock_user(argptr, guest_data, 0); 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, ...@@ -3695,6 +3696,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
break; break;
} }
default: default:
unlock_user(argptr, guest_data, 0);
ret = -TARGET_EINVAL; ret = -TARGET_EINVAL;
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册