> Fix a memory leak by freeing ppi.buf in tpm_crb_unrealize.
> 
> Signed-off-by: Stefan Berger <[email protected]>
> Message-ID: <[email protected]>
>
> diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
> index 9a9677db6b19..4bd1919952c1 100644
> --- a/hw/tpm/tpm_crb.c
> +++ b/hw/tpm/tpm_crb.c
> @@ -16,6 +16,7 @@
>  
>  #include "qemu/osdep.h"
>  
> +#include "qemu/memalign.h"
>  #include "qemu/module.h"
>  #include "qemu/error-report.h"
>  #include "qapi/error.h"
> @@ -529,6 +530,8 @@ static void tpm_crb_unrealize(DeviceState *dev)
>      if (s->migration_blocker) {
>          migrate_del_blocker(&s->migration_blocker);
>      }
> +
> +    qemu_vfree(s->ppi.buf);

We should have tpm_ppi_uninit(), there are other things that needs
to be taken care of, such add memory region and vmstate...

-- 
Marc-AndrĂ© Lureau <[email protected]>


Reply via email to