From nobody Sun May 5 03:06:37 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496644885581351.44706231885664; Sun, 4 Jun 2017 23:41:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B1E2F21A09105; Sun, 4 Jun 2017 23:40:17 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 4F71521A16E4A for ; Sun, 4 Jun 2017 23:40:16 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2017 23:41:21 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.15]) by fmsmga006.fm.intel.com with ESMTP; 04 Jun 2017 23:41:20 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,299,1493708400"; d="scan'208";a="110913822" From: Star Zeng To: edk2-devel@lists.01.org Date: Mon, 5 Jun 2017 14:41:10 +0800 Message-Id: <1496644870-31620-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [PATCH] MdePkg SmmIoLib: Use NULL pointer check instead of useless Status check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D587 The Status check in "if (!EFI_ERROR (Status))" condition is useless, it should be NULL pointer check. And this patch also fixes a typo "continous" to "continuous". Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Library/SmmIoLib/SmmIoLib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MdePkg/Library/SmmIoLib/SmmIoLib.c b/MdePkg/Library/SmmIoLib/S= mmIoLib.c index 181abb8e25df..f1cb0dace500 100644 --- a/MdePkg/Library/SmmIoLib/SmmIoLib.c +++ b/MdePkg/Library/SmmIoLib/SmmIoLib.c @@ -156,7 +156,7 @@ SmmIsMmioValid ( } =20 /** - Merge continous entries whose type is EfiGcdMemoryTypeMemoryMappedIo. + Merge continuous entries whose type is EfiGcdMemoryTypeMemoryMappedIo. =20 @param[in, out] GcdMemoryMap A pointer to the buffer in which= firmware places the current GCD memory map. @@ -217,7 +217,8 @@ MergeGcdMmioEntry ( @param[in] Interface Points to the interface instance. @param[in] Handle The handle on which the interface was installed. =20 - @retval EFI_SUCCESS Notification runs successfully. + @retval EFI_SUCCESS Notification runs successfully. + @retval EFI_OUT_OF_RESOURCES No enough resources to save GCD MMIO map. **/ EFI_STATUS EFIAPI @@ -237,10 +238,10 @@ SmmIoLibInternalEndOfDxeNotify ( MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors); =20 mSmmIoLibGcdMemSpace =3D AllocateCopyPool (NumberOfDescriptors * sizeo= f (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT (mSmmIoLibGcdMemSpace !=3D NULL); + if (mSmmIoLibGcdMemSpace =3D=3D NULL) { gBS->FreePool (MemSpaceMap); - return Status; + return EFI_OUT_OF_RESOURCES; } =20 mSmmIoLibGcdMemNumberOfDesc =3D NumberOfDescriptors; --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel