Hi Ilias,

 

 

From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Date: Saturday, 27 March 2021 at 20:49
To: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH 1/3 v7] Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver

On Sat, Mar 27, 2021 at 01:25:41PM -0700, Sami Mujawar wrote:
> Hi Ilias,
>
> On Sat, Mar 13, 2021 at 10:31 AM, Ilias Apalodimas wrote:
>
> >
> > + NumBytes =3D NumLba * Instance->BlockSize;=0D
> > + Base =3D (VOID *)Instance->MemBaseAddress + Start * Instance->BlockSiz=
> > e;=0D
> > + Buf =3D AllocatePool (NumLba * Instance->BlockSize);=0D
> > + if (Buf =3D=3D NULL) {=0D
> > + return EFI_DEVICE_ERROR;=0D
> > + }=0D
> > + SetMem64 (Buf, NumLba * Instance->BlockSize, ~0UL);=0D
> > + // Write the device=0D
> > + Status =3D ReadWriteRpmb (=0D
> > + SP_SVC_RPMB_WRITE,=0D
> > + (UINTN)Buf,=0D
> > + NumBytes,=0D
> > + Start * Instance->BlockSize=0D
> > + );=0D
> > + if (EFI_ERROR (Status)) {=0D
>
> I think there is a memory leak here as Buf is not freed. If you agree, I will fix this locally before merging the changes.

Yes there is, please do and let me know if you need anything else.
Thanks for the catch!

[SAMI] I will change this before pushing.

Reviewed-by: Sami Mujawar sami.mujawar@arm.com

 

Regards,

 

Sami Mujawar

 


Cheers
/Ilias
>
> >
> > + return Status;=0D
> > + }=0D
> > + // Update the in memory copy=0D
> > + SetMem64 (Base, NumLba * Instance->BlockSize, ~0UL);=0D
> > + FreePool (Buf);=0D
> > + }=0D
> > +=0D
> > + VA_END (Args);=0D
> > +=0D
> > + return EFI_SUCCESS;=0D
> > +}=0D
>
> Regards,
>
> Sami Mujawar

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.