ConfigRequestHdr = HiiConstructConfigHdr (&gHttpBootConfigGuid, mHttpBootConfigStorageName, CallbackInfo->ChildHandle);\r
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);\r
ConfigRequest = AllocateZeroPool (Size);\r
- ASSERT (ConfigRequest != NULL);\r
+ if (ConfigRequest == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
AllocatedRequest = TRUE;\r
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);\r
FreePool (ConfigRequestHdr);\r
// Get user input URI string\r
//\r
Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);\r
- ASSERT (Uri != NULL);\r
if (Uri == NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
@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
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
ConfigRequestHdr = HiiConstructConfigHdr (&gIScsiConfigGuid, mVendorStorageName, Private->DriverHandle);\r
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);\r
ConfigRequest = AllocateZeroPool (Size);\r
- ASSERT (ConfigRequest != NULL);\r
+ if (ConfigRequest == NULL) {\r
+ FreePool (IfrNvData);\r
+ FreePool (InitiatorName);\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
AllocatedRequest = TRUE;\r
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);\r
FreePool (ConfigRequestHdr);\r
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
@retval EFI_NOT_FOUND There is no sufficient information to establish\r
the iScsi session.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
@retval EFI_DEVICE_ERROR Failed to get TCP connection device path.\r
@retval EFI_ACCESS_DENIED The protocol could not be removed from the Handle\r
because its interfaces are being used.\r
\r
@retval EFI_SUCCESS The configuration data is retrieved.\r
@retval EFI_NOT_FOUND This iSCSI driver is not configured yet.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
\r
**/\r
EFI_STATUS\r
mPrivate->PortString,\r
NULL\r
);\r
- ASSERT (AttemptConfigData->AttemptTitleHelpToken != 0);\r
+ if (AttemptConfigData->AttemptTitleHelpToken == 0) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
\r
//\r
// Record the attempt in global link list.\r
/** @file\r
The implementation of iSCSI protocol based on RFC3720.\r
\r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
}\r
\r
LoginReq = (ISCSI_LOGIN_REQUEST *) NetbufAllocSpace (Nbuf, sizeof (ISCSI_LOGIN_REQUEST), NET_BUF_TAIL);\r
- ASSERT (LoginReq != NULL);\r
+ if (LoginReq == NULL) {\r
+ NetbufFree (Nbuf);\r
+ return NULL;\r
+ }\r
ZeroMem (LoginReq, sizeof (ISCSI_LOGIN_REQUEST));\r
\r
//\r
}\r
\r
Header = NetbufAllocSpace (PduHdr, Len, NET_BUF_TAIL);\r
- ASSERT (Header != NULL);\r
+ if (Header == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto ON_EXIT;\r
+ }\r
InsertTailList (NbufList, &PduHdr->List);\r
\r
//\r
InsertTailList (NbufList, &PduHdr->List);\r
\r
DataOutHdr = (ISCSI_SCSI_DATA_OUT *) NetbufAllocSpace (PduHdr, sizeof (ISCSI_SCSI_DATA_OUT), NET_BUF_TAIL);\r
- ASSERT (DataOutHdr != NULL);\r
+ if (DataOutHdr == NULL) {\r
+ IScsiFreeNbufList (NbufList);\r
+ return NULL;\r
+ }\r
XferContext = &Tcb->XferContext;\r
\r
ZeroMem (DataOutHdr, sizeof (ISCSI_SCSI_DATA_OUT));\r