]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
Add some ASSERT()s.
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePathFromText.c
index e0f1fcea489c877c73dc39408b1a136573f25f9e..f7e7cdfcfb612cb3daa22a0fd0345940f17e7abe 100644 (file)
@@ -2763,6 +2763,7 @@ ConvertTextToDeviceNode (
   ParamStr      = NULL;\r
   DumpNode      = NULL;\r
   DeviceNodeStr = StrDuplicate (TextDeviceNode);\r
+  ASSERT (DeviceNodeStr != NULL);\r
 \r
   for (Index = 0; DevPathFromTextTable[Index].Function; Index++) {\r
     ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText);\r
@@ -2822,6 +2823,7 @@ ConvertTextToDevicePath (
   }\r
 \r
   DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
+  ASSERT (DevicePath != NULL);\r
   SetDevicePathEndNode (DevicePath);\r
 \r
   ParamStr            = NULL;\r
@@ -2857,6 +2859,7 @@ ConvertTextToDevicePath (
 \r
     if (IsInstanceEnd != 0) {\r
       DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
+      ASSERT (DeviceNode != NULL);\r
       SET_DEVICE_PATH_INSTANCE_END_NODE (DeviceNode);\r
 \r
       NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode);\r