summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/IScsiDxe
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-10-27 10:17:08 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-10-30 08:51:59 +0800
commit0e7794d36d424338235f9f2e2cda8143521273b0 (patch)
tree8c99a166c4788bf5ca09e2676e7d394e2981e2df /NetworkPkg/IScsiDxe
parent770f9aae09cb6291db5a28ca2eb1ebf5696e9418 (diff)
downloadedk2-0e7794d36d424338235f9f2e2cda8143521273b0.tar.gz
edk2-0e7794d36d424338235f9f2e2cda8143521273b0.tar.bz2
edk2-0e7794d36d424338235f9f2e2cda8143521273b0.zip
NetworkPkg/IScsiDxe: Add check to avoid use NULL pointer
Cc: Wu Hao A <hao.a.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'NetworkPkg/IScsiDxe')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiConfig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 338298213d..62df367da7 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -3596,6 +3596,10 @@ IScsiFormCallback (
switch (Value->u8) {
case IP_MODE_IP6:
NicInfo = IScsiGetNicInfoByIndex (Private->Current->NicIndex);
+ if(NicInfo == NULL) {
+ break;
+ }
+
if(!NicInfo->Ipv6Available) {
//
// Current NIC doesn't Support IPv6, hence use IPv4.