* [Qemu-devel] [PATCH] target-ppc: Fix overallocation of opcode tables
@ 2014-03-19 14:07 Stuart Brady
2014-03-19 15:14 ` [Qemu-devel] [Qemu-ppc] " Tom Musta
0 siblings, 1 reply; 3+ messages in thread
From: Stuart Brady @ 2014-03-19 14:07 UTC (permalink / raw)
To: qemu-trivial; +Cc: qemu-ppc, Alexander Graf, qemu-devel
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 <sdb@zubnet.me.uk>
---
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: Fix overallocation of opcode tables
2014-03-19 14:07 [Qemu-devel] [PATCH] target-ppc: Fix overallocation of opcode tables Stuart Brady
@ 2014-03-19 15:14 ` Tom Musta
2014-03-19 22:19 ` Andreas Färber
0 siblings, 1 reply; 3+ messages in thread
From: Tom Musta @ 2014-03-19 15:14 UTC (permalink / raw)
To: Stuart Brady, qemu-trivial; +Cc: qemu-ppc, qemu-devel
On 3/19/2014 9:07 AM, Stuart Brady wrote:
> 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 <sdb@zubnet.me.uk>
> ---
> 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);
>
Reviewed-by: Tom Musta <tommusta@gmail.com>
Tested-by: Tom Musta <tommusta@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: Fix overallocation of opcode tables
2014-03-19 15:14 ` [Qemu-devel] [Qemu-ppc] " Tom Musta
@ 2014-03-19 22:19 ` Andreas Färber
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2014-03-19 22:19 UTC (permalink / raw)
To: Tom Musta, Stuart Brady; +Cc: qemu-trivial, qemu-ppc, qemu-devel
Am 19.03.2014 16:14, schrieb Tom Musta:
> On 3/19/2014 9:07 AM, Stuart Brady wrote:
>> 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 <sdb@zubnet.me.uk>
>
> Reviewed-by: Tom Musta <tommusta@gmail.com>
> Tested-by: Tom Musta <tommusta@gmail.com>
Thanks, applied to my ppc-next:
https://github.com/afaerber/qemu-cpu/commits/ppc-next
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-19 22:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 14:07 [Qemu-devel] [PATCH] target-ppc: Fix overallocation of opcode tables Stuart Brady
2014-03-19 15:14 ` [Qemu-devel] [Qemu-ppc] " Tom Musta
2014-03-19 22:19 ` Andreas Färber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).