Am 05.09.2012 18:55, schrieb Stefan Hajnoczi:
On Wed, Sep 5, 2012 at 4:51 PM, Andreas Färber<afaer...@suse.de> 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<s...@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)
{
*-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
AFAIK, binutils moved to GPL 3. Therefore I don't expect that
QEMU will update to upstream in the next years.
We'll have to maintain the code which we have.
Try "git log *-dis.c" or "gitk *-dis.c": there are already lots
of more trivial changes which got applied to the disassembler files.
=> The patch should be applied.
Regards,
Stefan