]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/DevicePathFromText: Fix bug when converting iSCSI node
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 2 Mar 2018 11:45:15 +0000 (19:45 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Sat, 3 Mar 2018 07:12:49 +0000 (15:12 +0800)
If protocol string is not specified, default TCP(0) should be used.
Today's implementation wrongly sets to 1 for this case.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c

index 0459f0ab253cd48ec1f1b8b6bf1cd6882699ee1c..c66b77ba6c69a902cac63de0d96183ee35c15fcd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DevicePathFromText protocol as defined in the UEFI 2.0 specification.\r
 \r
-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2018, 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
@@ -2581,7 +2581,7 @@ DevPathFromTextiSCSI (
 \r
   ISCSIDevPath->LoginOption      = (UINT16) Options;\r
 \r
-  if (StrCmp (ProtocolStr, L"TCP") == 0) {\r
+  if (IS_NULL (*ProtocolStr) || (StrCmp (ProtocolStr, L"TCP") == 0)) {\r
     ISCSIDevPath->NetworkProtocol = 0;\r
   } else {\r
     //\r