summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-06-21 14:40:28 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-06-23 09:27:14 +0800
commit7c275b3cde5fdc3cf6fac068c52455927d09c1c1 (patch)
tree89f56e3ba6f93ceb5081d062be7430ef7acce000 /NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
parent3460c75dfe951c50d1d16eb2bb54b4790d49a91d (diff)
downloadedk2-7c275b3cde5fdc3cf6fac068c52455927d09c1c1.tar.gz
edk2-7c275b3cde5fdc3cf6fac068c52455927d09c1c1.tar.bz2
edk2-7c275b3cde5fdc3cf6fac068c52455927d09c1c1.zip
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>
Diffstat (limited to 'NetworkPkg/HttpBootDxe/HttpBootDhcp6.c')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDhcp6.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c b/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
index 0157095edf..9ea421d758 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
@@ -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;