From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9HtD-0003g8-IK for qemu-devel@nongnu.org; Wed, 05 Sep 2012 11:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Ht7-0000id-NN for qemu-devel@nongnu.org; Wed, 05 Sep 2012 11:51:39 -0400 Message-ID: <504774FF.6000501@suse.de> Date: Wed, 05 Sep 2012 17:51:27 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1346703803-22003-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1346703803-22003-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-15 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: Stefan Weil Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi , qemu-devel@nongnu.org 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() >=20 > Signed-off-by: Stefan Weil > --- >=20 > Coding style was not fixed. >=20 > - sw >=20 > sparc-dis.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > 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_tab= le, > =20 > 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. 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? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg