Reviewed-by: Nickle Wang <nick...@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: abner.ch...@amd.com <abner.ch...@amd.com>
> Sent: Monday, November 27, 2023 1:31 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang <nick...@nvidia.com>; Igor Kulchytskyy <ig...@ami.com>;
> Mike Maslenkin <mike.maslen...@gmail.com>
> Subject: [PATCH V3 9/9] RedfishPkg/HostInterfaceBmcUsbNic: Fix potential
> memory corruption issue
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang <abner.ch...@amd.com>
> 
> Wrong memory allocation issue may result in memory corruption.
> 
> Signed-off-by: Abner Chang <abner.ch...@amd.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> Cc: Mike Maslenkin <mike.maslen...@gmail.com>
> ---
>  .../PlatformHostInterfaceBmcUsbNicLib.c                       | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> index a1ce2dd3d93..2938d54da65 100644
> ---
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostI
> +++ nterfaceBmcUsbNicLib.c
> @@ -1060,7 +1060,7 @@ IdentifyUsbNicBmcChannel (
> 
>    InitializeListHead (&BmcUsbNic->NextInstance);
>    BmcUsbNic->MacAddressSize = Snp->Mode->HwAddressSize;
> -  BmcUsbNic->MacAddress     = AllocateZeroPool (sizeof (BmcUsbNic-
> >MacAddressSize));
> +  BmcUsbNic->MacAddress     = AllocatePool (BmcUsbNic->MacAddressSize);
>    if (BmcUsbNic->MacAddress == NULL) {
>      DEBUG ((DEBUG_ERROR, "    Failed to allocate memory for HW MAC
> addresss.\n"));
>      FreePool (BmcUsbNic);
> @@ -1133,7 +1133,7 @@ CheckBmcUsbNicOnHandles (
>                      (VOID **)&DevicePath
>                      );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "    Failed to locate device path on %d 
> handle.\n",
> __func__, Index));
> +      DEBUG ((DEBUG_ERROR, "    Failed to locate device path on %d 
> handle.\n",
> Index));
>        continue;
>      }
> 
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112016): https://edk2.groups.io/g/devel/message/112016
Mute This Topic: https://groups.io/mt/102824324/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to