From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web12.22.1616878181956366118 for ; Sat, 27 Mar 2021 13:49:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=IPyEfkFx; spf=pass (domain: linaro.org, ip: 209.85.218.50, mailfrom: ilias.apalodimas@linaro.org) Received: by mail-ej1-f50.google.com with SMTP id u9so13540391ejj.7 for ; Sat, 27 Mar 2021 13:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PydDMDMupKRtwuJYuAyMrc3GSoK9zaRgqchY804RuOI=; b=IPyEfkFxCTgr071Xcq1F4QLJeeMkfYFqkSbwTLuWz+Rp8LSB58MprTO9AeadyEo5dM 5Gt7jJ9zT7dMiNfgS2m2MjpDCcusaXQiFOfLbYjSVJZhagQoYZ5K3nm5XtIEYaC1kj29 ISNlr6Gv4N7IjYOuZNk06ngFcQbs1NiwZbIQYR1tkgniOQRW+3u1m2sZRTEYyLJjeOC4 BRu8PMeSjRBsN5SOdxPIk63ElSgP9k2RBH/oThEk1Q3ziBRnGrxVs0A8jRRpINkfu7Oo tM1v/i51u/gpxPfgOTwRhIFw7hpxjBviVzpWQbn/9wIZAzB5S5ES4kwJV5tjNZRVv82P H30A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PydDMDMupKRtwuJYuAyMrc3GSoK9zaRgqchY804RuOI=; b=rboW+304mdaPHSLwC/LSnWJ58iR3aSB9M7ksNUfhgY1BXv7yiSr+KzHr5r6rA3EmEe rD9U3OL4KMwzr6eQZihHG83FVglbikhWaf77557CbcF5HKHfbDr9rcR08e4sE49rL4Au Gg13woKog/8kHylhezQ0C59IED/oWFC601BYX2kgnqqr6kA4Mk2Jazpo9J5sFLiXVzZy slTiX4z7YcK3fyJEuwQRRr4SeUtO8vMY+B1mn0dH3h5JLGWunh/nSj0WhnAizsoZpTM/ 0juswDcdJREmBkUpvoa2Hnmmx6sXjLWHom4ANk/HTsEaZZv2AjQBwQ5GnTWrHOh20RfM GwsQ== X-Gm-Message-State: AOAM532nyYO+OFYTbp0C1NlaX+Zz3d8bRWL/IQ+dyt7aho+vSdyA2zVt vfch7P+EDfc3iwIlubXzDBDmcA== X-Google-Smtp-Source: ABdhPJx8CRihz+1vCjwA6RjM256VCjL4mC3qANi5kqd8pMpnWKMJ26p4dhSzjmbXUr5Taa2g1nWUgg== X-Received: by 2002:a17:906:b80c:: with SMTP id dv12mr21898698ejb.110.1616878180529; Sat, 27 Mar 2021 13:49:40 -0700 (PDT) Return-Path: Received: from enceladus (ppp-94-64-113-158.home.otenet.gr. [94.64.113.158]) by smtp.gmail.com with ESMTPSA id k12sm6294858edo.50.2021.03.27.13.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 13:49:40 -0700 (PDT) Date: Sat, 27 Mar 2021 22:49:37 +0200 From: "Ilias Apalodimas" To: Sami Mujawar Cc: devel@edk2.groups.io Subject: Re: [edk2-devel] [PATCH 1/3 v7] Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver Message-ID: References: <20210313183139.3256104-2-ilias.apalodimas@linaro.org> <14174.1616876741028136783@groups.io> MIME-Version: 1.0 In-Reply-To: <14174.1616876741028136783@groups.io> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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! 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