[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user/syscall.c : Minor cleanups of timer_
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user/syscall.c : Minor cleanups of timer_create handling. |
Date: |
Sat, 2 Aug 2014 16:05:00 +0100 |
On 2 August 2014 15:10, Erik de Castro Lopo <address@hidden> wrote:
> * Add missing unlock of user struct.
> * Remove unneeded pointer variable.
>
> Signed-off-by: Erik de Castro Lopo <address@hidden>
> ---
> linux-user/syscall.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a50229d..7d8f54a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -9412,7 +9412,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
> {
> /* args: clockid_t clockid, struct sigevent *sevp, timer_t *timerid
> */
>
> - struct sigevent host_sevp = { {0}, }, *phost_sevp = NULL;
> + struct sigevent host_sevp = { {0}, };
> struct target_sigevent *ptarget_sevp;
> struct target_timer_t *ptarget_timer;
>
> @@ -9432,10 +9432,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
> host_sevp.sigev_signo = tswap32(ptarget_sevp->sigev_signo);
> host_sevp.sigev_notify = tswap32(ptarget_sevp->sigev_notify);
>
> - phost_sevp = &host_sevp;
> + unlock_user_struct(ptarget_sevp, arg2, 0);
> }
>
> - ret = get_errno(timer_create(clkid, phost_sevp, phtimer));
> + ret = get_errno(timer_create(clkid, &host_sevp, phtimer));
> if (ret) {
> phtimer = NULL;
> } else {
Doesn't this turn a timer_create(clkid, NULL, phtimer) into a
timer_create(clkid, something-not-NULL, phtimer) ? That
doesn't seem right to me (and the code you've deleted here
is the common idiom in syscall.c for handling those "arg
is pointer-to-struct-or-NULL" cases).
thanks
-- PMM
[Qemu-devel] [PATCH] linux-user: Add missing unlock_user_struct to timer_create., Erik de Castro Lopo, 2014/08/02