Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, November 24, 2022 10:01 AM
> To: mikuback@linux.microsoft.com; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Erich McMillan <emcmillan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [PATCH v1 08/12] PcAtChipsetPkg: Fix conditionally uninitialized variables
>
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
>
> > -----Original Message-----
> > From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
> > Sent: Wednesday, November 9, 2022 9:33 AM
> > To: devel@edk2.groups.io
> > Cc: Erich McMillan <emcmillan@microsoft.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Michael Kubacki
> > <mikuback@linux.microsoft.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: [PATCH v1 08/12] PcAtChipsetPkg: Fix conditionally uninitialized variables
> >
> > From: Michael Kubacki <michael.kubacki@microsoft.com>
> >
> > Fixes CodeQL alerts for CWE-457:
> > https://cwe.mitre.org/data/definitions/457.html
> >
> > Cc: Erich McMillan <emcmillan@microsoft.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Co-authored-by: Erich McMillan <emcmillan@microsoft.com>
> > Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> > ---
> > PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 9 ++++++---
> > 1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> b/PcAtChipsetPkg/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 = PcRtcGetWakeupTime (&Enabled, &Pending, &Time, Global);
> > - if ((Enabled) || (!EFI_ERROR (Status))) {
> > + if ((!EFI_ERROR (Status)) || (Enabled)) {
> > return EFI_SUCCESS;
> > }
> >
> > @@ -836,8 +836,11 @@ PcRtcSetWakeupTime (
> > //
> > // Just support set alarm time within 24 hours
> > //
> > - PcRtcGetTime (&RtcTime, &Capabilities, Global);
> > - Status = RtcTimeFieldsValid (&RtcTime);
> > + Status = PcRtcGetTime (&RtcTime, &Capabilities, Global);
> > + if (!EFI_ERROR (Status)) {
> > + Status = RtcTimeFieldsValid (&RtcTime);
> > + }
> > +
> > if (EFI_ERROR (Status)) {
> > return EFI_DEVICE_ERROR;
> > }
> > --
> > 2.28.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96609): https://edk2.groups.io/g/devel/message/96609
Mute This Topic: https://groups.io/mt/94918099/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-