public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Guomin Jiang" <guomin.jiang@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Jiang, Guomin" <guomin.jiang@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Correct dereferred pointer.
Date: Wed, 8 Apr 2020 05:29:04 +0000	[thread overview]
Message-ID: <DM6PR11MB2955D38B51E522EA2A6A48199DC00@DM6PR11MB2955.namprd11.prod.outlook.com> (raw)
In-Reply-To: <160150CCACE2328E.16021@groups.io>

Hi Kinney, Sean, Bret,

Could you help review the change.

Best Regards
guomin

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guomin
> Jiang
> Sent: Tuesday, March 31, 2020 2:50 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Correct
> dereferred pointer.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2609
> 
> The copied pointer (SavedState) will be updated by LoadUnitTestCache
> call. But the change of SavedState will not update source pointer, which
> is NewFramework->SavedState in this case.
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
> b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
> index b136992d99..71050b5618 100644
> --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
> +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
> @@ -209,7 +209,7 @@ InitUnitTestFramework (
>    EFI_STATUS                  Status;
> 
>    UNIT_TEST_FRAMEWORK_HANDLE  NewFrameworkHandle;
> 
>    UNIT_TEST_FRAMEWORK         *NewFramework;
> 
> -  UNIT_TEST_SAVE_HEADER       *SavedState;
> 
> +  UNIT_TEST_SAVE_HEADER       **SavedState;
> 
> 
> 
>    Status       = EFI_SUCCESS;
> 
>    NewFramework = NULL;
> 
> @@ -264,8 +264,8 @@ InitUnitTestFramework (
>    // If there is a persisted context, load it now.
> 
>    //
> 
>    if (DoesCacheExist (NewFrameworkHandle)) {
> 
> -    SavedState = (UNIT_TEST_SAVE_HEADER *)NewFramework->SavedState;
> 
> -    Status = LoadUnitTestCache (NewFrameworkHandle, &SavedState);
> 
> +    SavedState = (UNIT_TEST_SAVE_HEADER **)(&NewFramework-
> >SavedState);
> 
> +    Status = LoadUnitTestCache (NewFrameworkHandle, SavedState);
> 
>      if (EFI_ERROR (Status)) {
> 
>        //
> 
>        // Don't actually report it as an error, but emit a warning.
> 
> --
> 2.25.1.windows.1
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#56724): https://edk2.groups.io/g/devel/message/56724
> Mute This Topic: https://groups.io/mt/72671870/4399222
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [guomin.jiang@intel.com]
> -=-=-=-=-=-=


       reply	other threads:[~2020-04-08  5:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <160150CCACE2328E.16021@groups.io>
2020-04-08  5:29 ` Guomin Jiang [this message]
2020-04-08  5:59   ` [edk2-devel] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Correct dereferred pointer Sean
2020-04-09  1:29     ` Guomin Jiang
2020-04-10  7:17       ` Kun Qin
2020-04-13  6:20         ` Guomin Jiang
2020-04-13  6:47           ` Kun Qin

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=DM6PR11MB2955D38B51E522EA2A6A48199DC00@DM6PR11MB2955.namprd11.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