]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
NetworkPkg: Replace ASSERT with error handling in Http boot and IScsi
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootDhcp6.c
index 0157095edf821c4b89cd94a1edc205d18ebb5651..9ea421d758ecbe974b9ced885cab355302820d09 100644 (file)
@@ -401,6 +401,7 @@ HttpBootCacheDhcp6Offer (
   @retval EFI_NOT_READY         Only used in the Dhcp6Selecting state. The EFI DHCPv6 Protocol\r
                                 driver will continue to wait for more packets.\r
   @retval EFI_ABORTED           Told the EFI DHCPv6 Protocol driver to abort the current process.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -451,7 +452,9 @@ HttpBootDhcp6CallBack (
        ASSERT (NewPacket != NULL);\r
        SelectAd   = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp6.Packet.Offer;\r
        *NewPacket = AllocateZeroPool (SelectAd->Size);\r
-       ASSERT (*NewPacket != NULL);\r
+       if (*NewPacket == NULL) {\r
+         return EFI_OUT_OF_RESOURCES;\r
+       }\r
        CopyMem (*NewPacket, SelectAd, SelectAd->Size);\r
      }\r
      break;\r