From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K6p-0005ik-MX for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:13:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9K6o-0004W0-Dv for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:13:51 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:46140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K6o-0004Vl-7b for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:13:50 -0400 Message-ID: <5047965A.3020804@weilnetz.de> Date: Wed, 05 Sep 2012 20:13:46 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1346703803-22003-1-git-send-email-sw@weilnetz.de> <504774FF.6000501@suse.de> In-Reply-To: <504774FF.6000501@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed 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-15?Q?Andreas_F=E4rber?= Cc: Stefan Hajnoczi , qemu-devel@nongnu.org Am 05.09.2012 17:51, schrieb Andreas F=E4rber: > Am 03.09.2012 22:23, schrieb Stefan Weil: > =20 >> 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_ta= ble, >> >> 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) >> { >> =20 > *-dis sounds like binutils - did upstream drop the if, too? > If not, then diverging for a non-issue does not seem necessary. > > Having said that, it's amazing what fixes you come up with. Did you > describe the use of that tool in some posting or in the Wiki? > =20 I just added some initial text to http://wiki.qemu.org/Testing. > Regards, > Andreas > > =20