From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web10.37759.1683649949016839880 for ; Tue, 09 May 2023 09:32:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=KsdmBwFt; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: pedro.falcato@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-3f420618d5bso22612985e9.1 for ; Tue, 09 May 2023 09:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683649947; x=1686241947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gCTaKXR5qzg0Mj+lDMeusN6UokqfZojj35rV07wmegg=; b=KsdmBwFtd0myraPTL74tRyzO5LLf/4NPJpCwm/wHlbAKd0aYY64Czc0BP1Y4OZhfnC 1O4Dlna5g468DOOlvUb9iQ2O9RWQNWBO/uFDOTTul4twlR8GLw9z769Z9plbHgvap7dx zxeMTclGZp7x6Ik6ei7Fv77ltUgwKCFq1oaojkgXmrpFjMGIA59L8/sPfWtAA9rdHc2M OdQ6ejma+N96P9zcO/p3dbCGx0mFTRZXfoWmLOoBokfKYrTdYFnWtE1NFIM7ZAJQs0G3 41LwrPiDK33G33it37vsDi8J7ViMCFo3KetXikuEY0zpjx4AjXcVrORmLM6hcXx7WmWO jCUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683649947; x=1686241947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gCTaKXR5qzg0Mj+lDMeusN6UokqfZojj35rV07wmegg=; b=UDj/fZBqmnS2YGZaUEG3CwtqBRAArAC4MQZoevNESxbCh4yzTbI+ykBsbIZ9USi0GJ 2pYULcmYSOaYN/n/gmsrGVi4Exidh6TVwnJpNXq59HwnopIRlGi8paTj3EGepEqPLmpy 8+0vFMleSPEyuHXlvZDsRYuhA5HXohyW0+JtsJHIa7b8EFjfVGbHwgJA66eBHsXOEbL0 7aaK4DodCsafEbRiHLTCx9pDPgbMGLLWlTfYzwBf4FivHNtrSI8KBXHY6Ge8FkhL1Cj3 Z6aOb+xxGE6gH/Xh8aVqiQ9jzcO0fZxdBkBN4jYhJS96YvtdkT1e1He4ZOaj/x5FbHny kzNg== X-Gm-Message-State: AC+VfDzMYc++MG6EnhvausPGVFJC6E9z+FsOr6jWBIjUXjMD+sCzpDtX e1PqNwPIWxIYMqP2OgaShCtGeyZSJ4Xg0iRt X-Google-Smtp-Source: ACHHUZ7cFtCqVZzIqFdHzSDJbuVSaECffh/ssEi9dD0E/xj4AUyLzJCf4APITu+aHEyF7NH2Mtoxvw== X-Received: by 2002:a1c:7c0f:0:b0:3f4:219f:5b7a with SMTP id x15-20020a1c7c0f000000b003f4219f5b7amr6080677wmc.30.1683649946965; Tue, 09 May 2023 09:32:26 -0700 (PDT) Return-Path: Received: from PC-PEDRO-ARCH.lan ([2001:8a0:7280:5801:9441:3dce:686c:bfc7]) by smtp.gmail.com with ESMTPSA id p1-20020a05600c204100b003f0a6a1f969sm20363938wmg.46.2023.05.09.09.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 09:32:26 -0700 (PDT) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Laszlo Ersek , Pedro Falcato , Jian J Wang , Liming Gao , Hao A Wu , Ray Ni , Mike Maslenkin Subject: [PATCH v2 03/12] MdeModulePkg/SataControllerDxe: Remove useless null check Date: Tue, 9 May 2023 17:32:03 +0100 Message-Id: <20230509163212.291333-4-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509163212.291333-1-pedro.falcato@gmail.com> References: <20230509163212.291333-1-pedro.falcato@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ASSERT (Private != NULL) already covers this check. See commit 81310a6. Cc: Jian J Wang Cc: Liming Gao Cc: Hao A Wu Cc: Ray Ni Cc: Laszlo Ersek Cc: Mike Maslenkin Signed-off-by: Pedro Falcato --- .../Pci/SataControllerDxe/SataController.c | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c index 277bc6182db6..f0ffd311d7b9 100644 --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c @@ -626,34 +626,32 @@ SataControllerStop ( return Status; } - if (Private != NULL) { - if (Private->DisqualifiedModes != NULL) { - FreePool (Private->DisqualifiedModes); - } - - if (Private->IdentifyData != NULL) { - FreePool (Private->IdentifyData); - } + if (Private->DisqualifiedModes != NULL) { + FreePool (Private->DisqualifiedModes); + } - if (Private->IdentifyValid != NULL) { - FreePool (Private->IdentifyValid); - } + if (Private->IdentifyData != NULL) { + FreePool (Private->IdentifyData); + } - if (Private->PciAttributesChanged) { - // - // Restore original PCI attributes - // - Private->PciIo->Attributes ( - Private->PciIo, - EfiPciIoAttributeOperationSet, - Private->OriginalPciAttributes, - NULL - ); - } + if (Private->IdentifyValid != NULL) { + FreePool (Private->IdentifyValid); + } - FreePool (Private); + if (Private->PciAttributesChanged) { + // + // Restore original PCI attributes + // + Private->PciIo->Attributes ( + Private->PciIo, + EfiPciIoAttributeOperationSet, + Private->OriginalPciAttributes, + NULL + ); } + FreePool (Private); + // // Close protocols opened by Sata Controller driver // -- 2.40.1