From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E9986211B85F8 for ; Thu, 17 Jan 2019 23:18:02 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 23:18:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,489,1539673200"; d="scan'208";a="107535643" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.193.52]) by orsmga007.jf.intel.com with ESMTP; 17 Jan 2019 23:18:01 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Hao A , Wu Jiaxin Date: Fri, 18 Jan 2019 15:17:46 +0800 Message-Id: <20190118071747.18260-3-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190118071747.18260-1-Jiaxin.wu@intel.com> References: <20190118071747.18260-1-Jiaxin.wu@intel.com> Subject: [PATCH v3 2/3] NetworkPkg/IScsiDxe: Remove unnecessary NULL pointer check. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2019 07:18:03 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1469 Since the value of AttemptConfigData is retrieved from the list Entry, it can't be the NULL pointer, so just remove the unnecessary check. Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Hao A Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin --- NetworkPkg/IScsiDxe/IScsiConfig.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index 83644f51d8..78135b411c 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -1,9 +1,9 @@ /** @file Helper functions for configuring or getting the parameters relating to iSCSI. -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
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 http://opensource.org/licenses/bsd-license.php @@ -2290,14 +2290,10 @@ IScsiConfigDeleteAttempts ( // // Delete the attempt. // AttemptConfigData = NET_LIST_USER_STRUCT (Entry, ISCSI_ATTEMPT_CONFIG_NVDATA, Link); - if (AttemptConfigData == NULL) { - Status = EFI_NOT_FOUND; - goto Error; - } // // Remove this attempt from UI configured attempt list. // RemoveEntryList (&AttemptConfigData->Link); -- 2.17.1.windows.2