PcAtChipsetPkg: Fix conditionally uninitialized variables

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>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
This commit is contained in:
Michael Kubacki 2022-11-08 15:32:41 -05:00 committed by mergify[bot]
parent 3fab32d41d
commit 7dc182ed1e
1 changed files with 6 additions and 3 deletions

View File

@ -345,7 +345,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;
}
@ -838,8 +838,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;
}