]> 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 dbd371ce705c8160fb52d51c4765d38f5b4bd54a..f7e7cdfcfb612cb3daa22a0fd0345940f17e7abe 100644 (file)
@@ -1504,7 +1504,7 @@ DevPathFromTextUartFlowCtrl (
                                                         sizeof (UART_FLOW_CONTROL_DEVICE_PATH)\r
                                                         );\r
 \r
-  CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid);\r
+  CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid);\r
   if (StrCmp (ValueStr, L"XonXoff") == 0) {\r
     UartFlowControl->FlowControlMap = 2;\r
   } else if (StrCmp (ValueStr, L"Hardware") == 0) {\r
@@ -1555,7 +1555,7 @@ DevPathFromTextSAS (
                                        sizeof (SAS_DEVICE_PATH)\r
                                        );\r
 \r
-  CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid);\r
+  CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid);\r
   Strtoi64 (AddressStr, &Sas->SasAddress);\r
   Strtoi64 (LunStr, &Sas->Lun);\r
   Sas->RelativeTargetPort = (UINT16) Strtoi (RTPStr);\r
@@ -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