Reviewed-by: Michael D Kinney <[email protected]>

> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Wednesday, November 9, 2022 9:33 AM
> To: [email protected]
> Cc: Erich McMillan <[email protected]>; Kinney, Michael D 
> <[email protected]>; Michael Kubacki
> <[email protected]>; Ni, Ray <[email protected]>
> Subject: [PATCH v1 08/12] PcAtChipsetPkg: Fix conditionally uninitialized 
> variables
> 
> From: Michael Kubacki <[email protected]>
> 
> Fixes CodeQL alerts for CWE-457:
> https://cwe.mitre.org/data/definitions/457.html
> 
> Cc: Erich McMillan <[email protected]>
> Cc: Michael D Kinney <[email protected]>
> Cc: Michael Kubacki <[email protected]>
> Cc: Ray Ni <[email protected]>
> Co-authored-by: Erich McMillan <[email protected]>
> Signed-off-by: Michael Kubacki <[email protected]>
> ---
>  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 (#96601): https://edk2.groups.io/g/devel/message/96601
Mute This Topic: https://groups.io/mt/94918099/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to