mirror of https://github.com/acidanthera/audk.git
RedfishPkg/HostInterfaceBmcUsbNic: Fix potential memory corruption issue
Wrong memory allocation issue may result in memory corruption. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com> Acked-by: Mike Maslenkin <mike.maslenkin@gmail.com>
This commit is contained in:
parent
5cdeff1eb3
commit
120aa60644
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue