public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jiaxin Wu <jiaxin.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Wu Hao A <hao.a.wu@intel.com>, Ye Ting <ting.ye@intel.com>,
	Fu Siyuan <siyuan.fu@intel.com>, Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 2/2] NetworkPkg/IScsiDxe: Add check to avoid use NULL pointer
Date: Fri, 27 Oct 2017 10:23:45 +0800	[thread overview]
Message-ID: <1509071025-38548-3-git-send-email-jiaxin.wu@intel.com> (raw)
In-Reply-To: <1509071025-38548-1-git-send-email-jiaxin.wu@intel.com>

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>
---
 NetworkPkg/IScsiDxe/IScsiConfig.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 3382982..62df367 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -3594,10 +3594,14 @@ IScsiFormCallback (
 
     case KEY_IP_MODE:
       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.    
           //    
           IfrNvData->IpMode = IP_MODE_IP4;
-- 
1.9.5.msysgit.1



  parent reply	other threads:[~2017-10-27  2:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  2:23 [Patch 0/2] Add check to avoid use NULL pointer Jiaxin Wu
2017-10-27  2:23 ` [Patch 1/2] NetworkPkg/HttpBootDxe: " Jiaxin Wu
2017-10-27  2:23 ` Jiaxin Wu [this message]
2017-10-27  3:24 ` [Patch 0/2] " Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509071025-38548-3-git-send-email-jiaxin.wu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox