From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFiza-0004ZZ-6F for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFizZ-0007ir-4F for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:50 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:39659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFizY-0007aL-K7 for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:49 -0400 Received: by mail-wg0-f53.google.com with SMTP id dr1so3090777wgb.10 for ; Sun, 23 Sep 2012 03:00:48 -0700 (PDT) From: Stefan Hajnoczi Date: Sun, 23 Sep 2012 11:00:18 +0100 Message-Id: <1348394420-28298-13-git-send-email-stefanha@gmail.com> In-Reply-To: <1348394420-28298-1-git-send-email-stefanha@gmail.com> References: <1348394420-28298-1-git-send-email-stefanha@gmail.com> Subject: [Qemu-devel] [PATCH 12/14] 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: Anthony Liguori Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi From: 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 Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- 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 6257a04..471d060 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; } -- 1.7.10.4