Hi Ray,
        Are you the owner of this module (UefiBootManagerLib)? If so, could you 
help to review and commit it?  If not, could you tell me who is the owner? 
        In addition, the attached patch would also need your help to get 
committed. Thanks!

Regards,
Sunny Wang

-----Original Message-----
From: Tian, Feng [mailto:[email protected]] 
Sent: Thursday, October 29, 2015 8:21 AM
To: El-Haj-Mahmoud, Samer; Wang, Sunny (HPS SW); [email protected]
Cc: Tian, Feng
Subject: RE: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues
Importance: High

I will let module owner review and commit it.

Thanks
Feng

-----Original Message-----
From: El-Haj-Mahmoud, Samer [mailto:[email protected]] 
Sent: Wednesday, October 28, 2015 22:58
To: Wang, Sunny (HPS SW); [email protected]; Tian, Feng
Subject: RE: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues

+ MdeModuklePkg maintainers.

Can someone help by committing this please?



-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of 
El-Haj-Mahmoud, Samer
Sent: Tuesday, October 27, 2015 10:14 AM
To: Wang, Sunny (HPS SW) <[email protected]>; [email protected]
Subject: Re: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues

Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Wang, 
Sunny (HPS SW)
Sent: Tuesday, October 27, 2015 3:47 AM
To: [email protected]
Cc: El-Haj-Mahmoud, Samer <[email protected]>
Subject: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues

Fix memory leak issues

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <[email protected]>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c
index 86b4fac..0830166 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c
@@ -2,6 +2,7 @@
   Library functions which contain all the code to connect console device.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -301,6 +302,7 @@ 
BmUpdateSystemTableConsole (
   EFI_DEVICE_PATH_PROTOCOL        *FullDevicePath;
   EFI_DEVICE_PATH_PROTOCOL        *VarConsole;
   EFI_DEVICE_PATH_PROTOCOL        *Instance;
+  EFI_DEVICE_PATH_PROTOCOL        *FullInstance;
   VOID                            *Interface;
   EFI_HANDLE                      NewHandle;
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; @@ -354,6 +356,7 @@ 
BmUpdateSystemTableConsole (
     //
     // Find console device handle by device path instance
     //
+    FullInstance = Instance;
     Status = gBS->LocateDevicePath (
                     ConsoleGuid,
                     &Instance,
@@ -383,15 +386,18 @@ BmUpdateSystemTableConsole (
             TextOut->SetMode (TextOut, 0);
           }
         }
+        FreePool (FullDevicePath);
+        FreePool (FullInstance);
         return TRUE;
       }
     }
-
+    FreePool (FullInstance);
   } while (Instance != NULL);
 
   //
   // No any available console devcie found.
   //
+  FreePool (FullDevicePath);
   return FALSE;
 }
 
--
2.5.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

--- Begin Message ---
Hi Ray,
        Could you help to commit this code change? Thanks in advance.

-----Original Message-----
From: El-Haj-Mahmoud, Samer
Sent: Friday, October 23, 2015 1:18 AM
To: Wang, Sunny (HPS SW); [email protected]; Ni, Ruiyu
Subject: RE: [PATCH v2] MdeModulePkg: Make the BmFindLoadOption function public
Importance: High

Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>


-----Original Message-----
From: Ni, Ruiyu [mailto:[email protected]]
Sent: Tuesday, October 20, 2015 4:15 PM
To: Wang, Sunny (HPS SW); [email protected]
Cc: El-Haj-Mahmoud, Samer
Subject: RE: [PATCH v2] MdeModulePkg: Make the BmFindLoadOption function public
Importance: High

Reviewed-by: Ruiyu Ni <[email protected]>


-----Original Message-----
From: Wang, Sunny (HPS SW)
Sent: Monday, October 19, 2015 2:46 AM
To: [email protected]; Ni, Ruiyu <[email protected]>
Cc: El-Haj-Mahmoud, Samer <[email protected]>; Wang, Sunny (HPS SW) 
<[email protected]>
Subject: RE: [PATCH v2] MdeModulePkg: Make the BmFindLoadOption function public

Hi Ray,
        Could you help to review the updated patch?

Regards,
Sunny Wang

-----Original Message-----
From: Wang, Sunny (HPS SW)
Sent: Tuesday, October 13, 2015 6:10 PM
To: [email protected]
Cc: El-Haj-Mahmoud, Samer; Wang, Sunny (HPS SW)
Subject: [PATCH v2] MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <[email protected]>
Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h  | 22 ++++++++++++++++++++++
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c   | 10 +++++-----
 .../Library/UefiBootManagerLib/BmLoadOption.c      |  4 +++-
 .../Library/UefiBootManagerLib/InternalBm.h        | 22 +---------------------
 4 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index 5538d90..54a6713 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.

 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -222,6 +223,27 
@@ EfiBootManagerSortLoadOptionVariable (
   IN SORT_COMPARE                      CompareFunction
   );

+/**
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the OptionType,
+ Attributes, Description, FilePath and OptionalData are equal.
+
+  @param Key    Pointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1          Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+EFIAPI
+EfiBootManagerFindLoadOption (
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
+  IN UINTN                              Count
+  );
+
 //
 // Boot Manager hot key library functions.
 //
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 8f14cf6..aef2e7b 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1,8 +1,8 @@
 /** @file
   Library functions which relates with booting.

-(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>  Copyright 
(c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -206,7 +206,7 @@ 
BmFindBootOptionInVariable (
   if (OptionNumber == LoadOptionNumberUnassigned) {
     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, 
LoadOptionTypeBoot);

-    Index = BmFindLoadOption (OptionToFind, BootOptions, BootOptionCount);
+    Index = EfiBootManagerFindLoadOption (OptionToFind, BootOptions,
+ BootOptionCount);
     if (Index != -1) {
       OptionNumber = BootOptions[Index].OptionNumber;
     }
@@ -2165,7 +2165,7 @@ EfiBootManagerRefreshAllBootOption (
       // Only check those added by BDS
       // so that the boot options added by end-user or OS installer won't be 
deleted
       //
-      if (BmFindLoadOption (&NvBootOptions[Index], BootOptions, 
BootOptionCount) == (UINTN) -1) {
+      if (EfiBootManagerFindLoadOption (&NvBootOptions[Index],
+ BootOptions, BootOptionCount) == (UINTN) -1) {
         Status = EfiBootManagerDeleteLoadOptionVariable 
(NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
         //
         // Deleting variable with current variable implementation shouldn't 
fail.
@@ -2179,7 +2179,7 @@ EfiBootManagerRefreshAllBootOption (
   // Add new EFI boot options to NV
   //
   for (Index = 0; Index < BootOptionCount; Index++) {
-    if (BmFindLoadOption (&BootOptions[Index], NvBootOptions, 
NvBootOptionCount) == (UINTN) -1) {
+    if (EfiBootManagerFindLoadOption (&BootOptions[Index],
+ NvBootOptions, NvBootOptionCount) == (UINTN) -1) {
       EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN) -1);
       //
       // Try best to add the boot options so continue upon failure.
@@ -2260,7 +2260,7 @@ BmRegisterBootManagerMenu (
     UINTN                           BootOptionCount;

     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, 
LoadOptionTypeBoot);
-    ASSERT (BmFindLoadOption (BootOption, BootOptions, BootOptionCount) == -1);
+    ASSERT (EfiBootManagerFindLoadOption (BootOption, BootOptions,
+ BootOptionCount) == -1);
     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
     );

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 6b9690a..07c3376 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -2,6 +2,7 @@
   Load option library functions which relate with creating and processing load 
options.

 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -504,7 +505,8 @@ 
EfiBootManagerInitializeLoadOption (
   @retval 0 ~ Count-1 The index of the Key in the Array.
 **/
 INTN
-BmFindLoadOption (
+EFIAPI
+EfiBootManagerFindLoadOption (
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
   IN UINTN                              Count
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h 
b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
index d415442..5af7f3b 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
+++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
@@ -2,6 +2,7 @@
   BDS library definition, include the file and data structure

 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -407,27 +408,6 
@@ BmDelPartMatchInstance (
   IN     EFI_DEVICE_PATH_PROTOCOL  *Single
   );

-
-/**
-  Return the index of the load option in the load option array.
-
-  The function consider two load options are equal when the
-  OptionType, Attributes, Description, FilePath and OptionalData are equal.
-
-  @param Key    Pointer to the load option to be found.
-  @param Array  Pointer to the array of load options to be found.
-  @param Count  Number of entries in the Array.
-
-  @retval -1          Key wasn't found in the Array.
-  @retval 0 ~ Count-1 The index of the Key in the Array.
-**/
-INTN
-BmFindLoadOption (
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
-  IN UINTN                              Count
-  );
-
 /**
   Repair all the controllers according to the Driver Health status queried.
 **/
--
2.5.0.windows.1


--- End Message ---
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to