public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
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
Date: Sun, 28 Mar 2021 10:30:36 +0000	[thread overview]
Message-ID: <AM6PR08MB3784E5F5078C1C6FFFAC92EC847F9@AM6PR08MB3784.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <YF+aYQhRtdFqCcgq@enceladus>

[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]

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<mailto: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.

[-- Attachment #2: Type: text/html, Size: 4664 bytes --]

  reply	other threads:[~2021-03-28 10:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 18:31 [PATCH 0/3 v7] Add support for running StandaloneMm as OP-TEE TA Ilias Apalodimas
2021-03-13 18:31 ` [PATCH 1/3 v7] Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver Ilias Apalodimas
2021-03-27 20:25   ` [edk2-devel] " Sami Mujawar
2021-03-27 20:49     ` Ilias Apalodimas
2021-03-28 10:30       ` Sami Mujawar [this message]
2021-03-13 18:31 ` [PATCH 2/3 v7] StMMRpmb: Add support for building StandaloneMm image for OP-TEE Ilias Apalodimas
2021-03-13 18:31 ` [PATCH 3/3 v7] Maintainers: Add maintainers for StandAloneMM and RPMB driver Ilias Apalodimas
2021-03-28 10:29   ` Sami Mujawar
2021-03-28 10:52 ` [PATCH 0/3 v7] Add support for running StandaloneMm as OP-TEE TA Sami Mujawar
2021-03-28 11:30   ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR08MB3784E5F5078C1C6FFFAC92EC847F9@AM6PR08MB3784.eurprd08.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox