NetworkPkg: Replace ASSERT with error handling in Http boot and IScsi
v2: *Fix some memory leak issue. This patch is used to replace ASSERT with error handling in Http boot Driver and IScsi driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
@@ -401,6 +401,7 @@ HttpBootCacheDhcp6Offer (
|
||||
@retval EFI_NOT_READY Only used in the Dhcp6Selecting state. The EFI DHCPv6 Protocol
|
||||
driver will continue to wait for more packets.
|
||||
@retval EFI_ABORTED Told the EFI DHCPv6 Protocol driver to abort the current process.
|
||||
@retval EFI_OUT_OF_RESOURCES There are not enough resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -451,7 +452,9 @@ HttpBootDhcp6CallBack (
|
||||
ASSERT (NewPacket != NULL);
|
||||
SelectAd = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp6.Packet.Offer;
|
||||
*NewPacket = AllocateZeroPool (SelectAd->Size);
|
||||
ASSERT (*NewPacket != NULL);
|
||||
if (*NewPacket == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyMem (*NewPacket, SelectAd, SelectAd->Size);
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user