[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH v2 2/7] hw/mips/mips_jazz.c: Store irq array i

From: Michael Tokarev
Subject: Re: [Qemu-trivial] [PATCH v2 2/7] hw/mips/mips_jazz.c: Store irq array in MachineState to fix memory leak
Date: Thu, 04 Jun 2015 17:18:46 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

30.05.2015 10:54, Shannon Zhao пишет:
> From: Shannon Zhao <address@hidden>
> Signed-off-by: Shannon Zhao <address@hidden>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
>  hw/mips/mips_jazz.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 2c153e0..259458b 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -135,7 +135,7 @@ static void mips_jazz_init(MachineState *machine,
>      MIPSCPU *cpu;
>      CPUClass *cc;
>      CPUMIPSState *env;
> -    qemu_irq *rc4030, *i8259;
> +    qemu_irq *i8259;

Hm. Why do you only cover rc4030, not i8259?

Besides, in order to keep the changes smaller, I think it is okay to
keep the variables like that, here and in the rest of the function,
and only add assignment of it to machine->irqs.  This way, we also
keep semantic names of the variables, rc4030[i] is easier to understand
than machine->irqs[i], the former's more specific.

BTW, there's also cpu_exit_irq in this function whose allocation also
suffers from qemu_allocate_irqs(..., 1) API abuse.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]