Hi

On Fri, May 22, 2026 at 12:17 AM Arun Menon <[email protected]> wrote:
>
> Hi,
>
> On Sat, May 16, 2026 at 11:59:17AM +0400, Marc-André Lureau wrote:
> > The PPI buffer is allocated with qemu_memalign() in instance_init but
> > never freed when the device is destroyed.
> >
> > Fixes: 46cd2c1050f0 ("hw/tpm: add PPI support to tpm-tis-device for ARM64 
> > virt")
> > Signed-off-by: Marc-André Lureau <[email protected]>
> > ---
> >  hw/tpm/tpm_tis_sysbus.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
> > index 6bec30c36fc..3984228c42f 100644
> > --- a/hw/tpm/tpm_tis_sysbus.c
> > +++ b/hw/tpm/tpm_tis_sysbus.c
> > @@ -150,11 +150,20 @@ static void tpm_tis_sysbus_class_init(ObjectClass 
> > *klass, const void *data)
> >      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> >  }
> >
> > +static void tpm_tis_sysbus_finalize(Object *obj)
> > +{
> > +    TPMStateSysBus *sbdev = TPM_TIS_SYSBUS(obj);
> > +    TPMState *s = &sbdev->state;
> > +
> > +    qemu_vfree(s->ppi.buf);
> > +}
> > +
> >  static const TypeInfo tpm_tis_sysbus_info = {
> >      .name = TYPE_TPM_TIS_SYSBUS,
> >      .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE,
> >      .instance_size = sizeof(TPMStateSysBus),
> >      .instance_init = tpm_tis_sysbus_initfn,
> > +    .instance_init = tpm_tis_sysbus_finalize,
>
> shouldn't this be .instance_finalize ?

Good catch! Weird, it made it through the test, Ill check!


Reply via email to