Received: from eggs.gnu.org ([2001:4830:134:3::10]:54309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG9sO-0005da-7E for qemu-devel@nongnu.org; Tue, 27 Jan 2015 12:24:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG9sK-0001bN-Tx for qemu-devel@nongnu.org; Tue, 27 Jan 2015 12:24:32 -0500 Message-ID: <54C7C9CB.5010905@msgid.tls.msk.ru> Date: Tue, 27 Jan 2015 20:24:27 +0300 From: Michael Tokarev MIME-Version: 1.0 References: <54C4322A.3060704@sunrus.com.cn> In-Reply-To: <54C4322A.3060704@sunrus.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] linux-user/syscall.c: Need call unlock_user() before go to failure return in default case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang S , Peter Maydell , Riku Voipio Cc: QEMU Trivial , qemu-devel 25.01.2015 03:00, Chen Gang S wrote: > In abi_long do_ioctl_dm(), after calls lock_user(), it does not call > unlock_user() before go to failure return in default case. Applied to -trivial, with the following description (modified just slightly, I tried to keep original wording as much as possible): 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. Thank you! /mjt > Signed-off-by: Chen Gang > --- > linux-user/syscall.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index a427f7a..ec9e4fc 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -3566,6 +3566,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); > @@ -3685,6 +3686,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; > } >