Received: from eggs.gnu.org ([208.118.235.92]:53219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFXFn-0000sO-Bu for qemu-devel@nongnu.org; Sat, 22 Sep 2012 17:28:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFXFm-0001y8-5R for qemu-devel@nongnu.org; Sat, 22 Sep 2012 17:28:47 -0400 Message-ID: <505E2D8B.5060309@weilnetz.de> Date: Sat, 22 Sep 2012 23:28:43 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1346789659-6824-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1346789659-6824-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Remove redundant null check and replace free by g_free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial Cc: Peter Maydell , Riku Voipio , qemu-devel@nongnu.org Am 04.09.2012 22:14, schrieb Stefan Weil: > Report from smatch: > > linux-user/syscall.c:3632 do_ioctl_dm(220) info: > redundant null check on big_buf calling free() > > 'big_buf' was allocated by g_malloc0, therefore free was also > replaced by g_free. > > Signed-off-by: Stefan Weil > --- > linux-user/syscall.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 1513f08..c3533da 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -3628,9 +3628,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, > unlock_user(argptr, arg, target_size); > } > out: > - if (big_buf) { > - free(big_buf); > - } > + g_free(big_buf); > return ret; > } > Ping? Maybe qemu-trivial can take that patch, it's trivial enough. Peter reviewed it, see http://patchwork.ozlabs.org/patch/181669/. Regards Stefan