From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Isk-00089m-SG for qemu-devel@nongnu.org; Wed, 05 Sep 2012 12:55:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Isg-0004wL-HK for qemu-devel@nongnu.org; Wed, 05 Sep 2012 12:55:14 -0400 MIME-Version: 1.0 In-Reply-To: <504774FF.6000501@suse.de> References: <1346703803-22003-1-git-send-email-sw@weilnetz.de> <504774FF.6000501@suse.de> Date: Wed, 5 Sep 2012 17:55:07 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-devel@nongnu.org On Wed, Sep 5, 2012 at 4:51 PM, Andreas F=E4rber wrote: > Am 03.09.2012 22:23, schrieb Stefan Weil: >> Report from smatch: >> sparc-dis.c:2664 build_hash_table(14) info: >> redundant null check on hash_buf calling free() >> >> Signed-off-by: Stefan Weil >> --- >> >> Coding style was not fixed. >> >> - sw >> >> sparc-dis.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/sparc-dis.c b/sparc-dis.c >> index cdd337a..ef28835 100644 >> --- a/sparc-dis.c >> +++ b/sparc-dis.c >> @@ -2660,8 +2660,7 @@ build_hash_table (const sparc_opcode **opcode_tabl= e, >> >> memset (hash_table, 0, HASH_SIZE * sizeof (hash_table[0])); >> memset (hash_count, 0, HASH_SIZE * sizeof (hash_count[0])); >> - if (hash_buf !=3D NULL) >> - free (hash_buf); >> + free (hash_buf); >> hash_buf =3D malloc (sizeof (* hash_buf) * num_opcodes); >> for (i =3D num_opcodes - 1; i >=3D 0; --i) >> { > > *-dis sounds like binutils - did upstream drop the if, too? > If not, then diverging for a non-issue does not seem necessary. Ah, good point. I don't think we should apply this patch :P. Dropping the patch from qemu-trivial until this discussion finishes. Stefan