From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.4190.1683582802836037560 for ; Mon, 08 May 2023 14:53:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=TMB9IQbV; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: pedro.falcato@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3075e802738so4398192f8f.1 for ; Mon, 08 May 2023 14:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683582801; x=1686174801; 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=DBaNUPnwkI8Kom5FW80cXcIYozNldzoDXluqdTOkyPg=; b=TMB9IQbVLbCmL/xVm4e+fhquVCA6Fek2yWZymZi9HRZCR4bEf6xmyBuB9pUyAbpVMD A6HErNM9k2yOrUNrMZWL1Iv6C5VDaq0aNRsJcnXUuCVmME0GTNWKqeGn6l/TV7mqN/lQ 28vMHvmLH4jb27q7sYpU3pQ0tSGdnU/GIcIbNbt/4aFqcWuez5q95LkGopw6npuMpevH Y3sAZ0bOji8K+MSgPR5zQTpyjW0xFiw1ejecZ3Wu7SfBgjA3pZRmqaowMsKHGz3iVfpw oqgxZFyqmHwKsU5Pt8kRdRd/RYPsifm1wH0VkqiwJa72/LkkAEeF5lbd5876NCMPBmoh NK+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683582801; x=1686174801; 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=DBaNUPnwkI8Kom5FW80cXcIYozNldzoDXluqdTOkyPg=; b=CF7IC2uZ9zAu8lOsCVuYzQSuubo64bEBEe6g0tYg70wrfdkNaABx8CQuwcpfXie4gu Zhj9vnG++KzqgB7Yr6HaOzLdC6/2/6cGDz1fUng8f1H9qkW+yunIZ9XrxPJUgABqe5Ve yIh/IjO4BPS+GoUNHibXSt3834SMaZNtX0TkRrfxVGvg6zdT9IJ608nqC7XeKtdxYgy6 ggJbOd/JAH3HjyTQlLk/F5NoJQBnE0L1u9znOQ5FUdUmTyor1jti2FCZMlJ6ez5vqqHn ed+LGom4TpYAmfUvUiAL7lOiSAyzhSc726DPHrtsDDGiVEBL+cCYkdBj/aIZF4yUHDiq qN5A== X-Gm-Message-State: AC+VfDzt5l2NNXVvSDGv9CdGlk/ZkZnR9xNHrG+HQYJZ1Ae0YeGk0pcW l4FqDTorW/u9irg3bXn4Tj8cJV2TcV+8hL7K X-Google-Smtp-Source: ACHHUZ6ur+0MGkOaXP1p9YUpanFrRaUhJtTHsH85RgHG/YltWHDWeLdEBsU5PM/ZkEL+Uxz8iGk5xw== X-Received: by 2002:adf:fe0e:0:b0:306:2f91:302e with SMTP id n14-20020adffe0e000000b003062f91302emr8719120wrr.21.1683582800756; Mon, 08 May 2023 14:53:20 -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 u16-20020a05600c00d000b003f428c4155csm2004316wmm.11.2023.05.08.14.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 14:53:20 -0700 (PDT) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Pedro Falcato , Jian J Wang , Liming Gao , Hao A Wu , Ray Ni Subject: [PATCH 1/2] MdeModulePkg/SataControllerDxe: Remove useless null check Date: Mon, 8 May 2023 22:52:45 +0100 Message-Id: <20230508215246.217002-2-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508215246.217002-1-pedro.falcato@gmail.com> References: <20230508215246.217002-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 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 f661efaec7e9..ab069845fd02 100644 --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c @@ -625,34 +625,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