[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] hw/arm/collie: Put StrongARMState* into a CollieMachineSt
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2] hw/arm/collie: Put StrongARMState* into a CollieMachineState struct |
Date: |
Thu, 26 Mar 2020 14:52:12 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/26/20 1:49 PM, Peter Maydell wrote:
> Coverity complains that the collie_init() function leaks the memory
> allocated in sa1110_init(). This is true but not significant since
> the function is called only once on machine init and the memory must
> remain in existence until QEMU exits anyway.
>
> Still, we can avoid the technical memory leak by keeping the pointer
> to the StrongARMState inside the machine state struct. Switch from
> the simple DEFINE_MACHINE() style to defining a subclass of
> TYPE_MACHINE which extends the MachineState struct, and keep the
> pointer there.
>
> Fixes: CID 1421921
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> v1->v2: folded in the uncommitted change that fixes the
> arm_load_kernel() first argument.
Reviewed-by: Richard Henderson <address@hidden>
r~