All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
@ 2012-09-03 20:23 Stefan Weil
  2012-09-05  9:34 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Weil @ 2012-09-03 20:23 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Stefan Weil, qemu-devel

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 <sw@weilnetz.de>
---

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_table,
 
   memset (hash_table, 0, HASH_SIZE * sizeof (hash_table[0]));
   memset (hash_count, 0, HASH_SIZE * sizeof (hash_count[0]));
-  if (hash_buf != NULL)
-    free (hash_buf);
+  free (hash_buf);
   hash_buf = malloc (sizeof (* hash_buf) * num_opcodes);
   for (i = num_opcodes - 1; i >= 0; --i)
     {
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-21  8:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-03 20:23 [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check Stefan Weil
2012-09-05  9:34 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
2012-09-05 16:55   ` Stefan Hajnoczi
2012-09-05 17:15     ` Stefan Weil
2012-09-05 17:45       ` Stefan Weil
2012-09-20 17:03         ` Stefan Weil
2012-09-21  8:06           ` Andreas Färber
2012-09-05 18:13   ` Stefan Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.