Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
}\r
Ascii2UnicodeString(Str, Str16);\r
DevicePath = UefiDevicePathLibConvertTextToDevicePath(Str16);\r
}\r
Ascii2UnicodeString(Str, Str16);\r
DevicePath = UefiDevicePathLibConvertTextToDevicePath(Str16);\r
+ if (DevicePath == NULL) {\r
+ fprintf(stderr, "Convert fail, Cannot convert text to a device path");\r
+ free(Str16);\r
+ return STATUS_ERROR;\r
+ }\r
while (!((DevicePath->Type == END_DEVICE_PATH_TYPE) && (DevicePath->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)) )\r
{\r
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);\r
while (!((DevicePath->Type == END_DEVICE_PATH_TYPE) && (DevicePath->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)) )\r
{\r
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);\r