summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-03-02 19:45:15 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-03-03 15:50:19 +0800
commitc5b32c02a47fc8b4152ee67a51aa24b2660705b0 (patch)
treeacd70d32abc331ccc7e5d242d794ed34e9d98138 /MdePkg
parentbce451d5f39a4f60fbdeec6c37be44127ec5216b (diff)
downloadedk2-c5b32c02a47fc8b4152ee67a51aa24b2660705b0.tar.gz
edk2-c5b32c02a47fc8b4152ee67a51aa24b2660705b0.tar.bz2
edk2-c5b32c02a47fc8b4152ee67a51aa24b2660705b0.zip
MdePkg/DevicePathFromText: Fix bug when converting iSCSI node
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> (cherry picked from commit e6c80aea71c7b7c6c22ed779d23bf7877a97e68d)
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index 0459f0ab25..c66b77ba6c 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1,7 +1,7 @@
/** @file
DevicePathFromText protocol as defined in the UEFI 2.0 specification.
-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -2581,7 +2581,7 @@ DevPathFromTextiSCSI (
ISCSIDevPath->LoginOption = (UINT16) Options;
- if (StrCmp (ProtocolStr, L"TCP") == 0) {
+ if (IS_NULL (*ProtocolStr) || (StrCmp (ProtocolStr, L"TCP") == 0)) {
ISCSIDevPath->NetworkProtocol = 0;
} else {
//