Received: from eggs.gnu.org ([2001:4830:134:3::10]:56102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQH9d-0005kl-Ll for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQH9Z-0007gv-VD for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:07:37 -0400 Received: from b.painless.aa.net.uk ([2001:8b0:0:30::51bb:1e34]:39329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQH9Z-0007gq-K7 for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:07:33 -0400 Date: Wed, 19 Mar 2014 14:07:26 +0000 From: Stuart Brady Message-ID: <20140319140726.GA9192@zubnet.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] target-ppc: Fix overallocation of opcode tables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org create_new_table() should allocate 0x20 opc_handler_t pointers, but actually allocates 0x20 opc_handler_t structs. Fix this. Signed-off-by: Stuart Brady --- translate_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 6084f40..75f34c1 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -7434,7 +7434,7 @@ static int create_new_table (opc_handler_t **table, unsigned char idx) { opc_handler_t **tmp; - tmp = g_malloc(0x20 * sizeof(opc_handler_t)); + tmp = g_new(opc_handler_t *, 0x20); fill_new_table(tmp, 0x20); table[idx] = (opc_handler_t *)((uintptr_t)tmp | PPC_INDIRECT);