From nobody Mon Sep 16 19:45:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101028+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101028+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1678473937; cv=none; d=zohomail.com; s=zohoarc; b=a1YI8Y6pB+CiFcvxy/gqI+XrVbrGGXmsOuJUDAvTqzkGE8a30HTrjY8NjandQIs4t3+DQmpr1jStf0KUSto1Xtlvu7CWqMyhou1/fzY0IazZ96ltKbN0t9sUxybDwuYHJbMUHBj+dL9PLk6RfZFYvklI6IWk9UEXH4eClt8SPmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678473937; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=CMygh+bIwFtz1YBdYcW+rIofGwaGQ9LP+VUqJh7gX3w=; b=Lv9gODJ4ghWKA+31PxVXTWQBvP+f0bsqHh+fOLqoQh/SW7JCK2OhY+i/mP8ygGWhyee50SvxXmejQdS9a5DDOt08OmFlM6YeQBTjFnf+24wAqg0p8EGkrgNE0w0y88QsbrUK7N5kLWL6ElK9OjTG8ftIwz+OS/q9qxHGEBwEJ+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101028+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678473937915428.22115052090317; Fri, 10 Mar 2023 10:45:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qBMqYY1788612x5mgX1rHP3x; Fri, 10 Mar 2023 10:45:37 -0800 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.27817.1678473937119046049 for ; Fri, 10 Mar 2023 10:45:37 -0800 X-Received: from localhost.localdomain (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 3BD3C20C14D5; Fri, 10 Mar 2023 10:45:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3BD3C20C14D5 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Erich McMillan , Michael D Kinney , Michael Kubacki , Ray Ni Subject: [edk2-devel] [PATCH v4 08/12] PcAtChipsetPkg: Fix conditionally uninitialized variables Date: Fri, 10 Mar 2023 13:42:34 -0500 Message-Id: <20230310184238.2999-9-mikuback@linux.microsoft.com> In-Reply-To: <20230310184238.2999-1-mikuback@linux.microsoft.com> References: <20230310184238.2999-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com X-Gm-Message-State: YHonilJQZssEFnCaRGSILmssx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678473937; bh=o5BpV21oU1J8wq6BStWtlkA3ZJ7pkVntG5EReZA4HwA=; h=Cc:Date:From:Reply-To:Subject:To; b=WH97jWBJviGxf8Xrc8r5U23ete1YIjpj4k8/sUi9lHtOJp1jHKn4O2ojJJsIb3sQ2Kr PoRFrZ3NOSRbNcLIoEN8LH28jyIw7V9lTMcT188mSytuUv/WJfEnSOMkSDwwdqd/72ViK S0M5bGqQ3az/UdN/jxG8CqW5th94Ox/N7/k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678473940176100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki Fixes CodeQL alerts for CWE-457: https://cwe.mitre.org/data/definitions/457.html Cc: Erich McMillan Cc: Michael D Kinney Cc: Michael Kubacki Cc: Ray Ni Co-authored-by: Erich McMillan Signed-off-by: Michael Kubacki Reviewed-by: Michael D Kinney Reviewed-by: Ray Ni --- PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c b/PcAtChips= etPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c index 9242a2e82600..57ea3153aa6b 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -344,7 +344,7 @@ PcRtcInit ( // so we can use them to get and set wakeup time. // Status =3D PcRtcGetWakeupTime (&Enabled, &Pending, &Time, Global); - if ((Enabled) || (!EFI_ERROR (Status))) { + if ((!EFI_ERROR (Status)) || (Enabled)) { return EFI_SUCCESS; } =20 @@ -836,8 +836,11 @@ PcRtcSetWakeupTime ( // // Just support set alarm time within 24 hours // - PcRtcGetTime (&RtcTime, &Capabilities, Global); - Status =3D RtcTimeFieldsValid (&RtcTime); + Status =3D PcRtcGetTime (&RtcTime, &Capabilities, Global); + if (!EFI_ERROR (Status)) { + Status =3D RtcTimeFieldsValid (&RtcTime); + } + if (EFI_ERROR (Status)) { return EFI_DEVICE_ERROR; } --=20 2.39.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101028): https://edk2.groups.io/g/devel/message/101028 Mute This Topic: https://groups.io/mt/97526799/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-