diff mbox

[edk2] EmbeddedPkg/RTC: use returned status at init-time

Message ID 1458851413-26577-7-git-send-email-leo.duran@amd.com
State Accepted
Commit da6ae666410e5b0354312e51c3e63775f79c33af
Headers show

Commit Message

Duran, Leo March 24, 2016, 8:30 p.m. UTC
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>

---
 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Ard Biesheuvel March 24, 2016, 9:51 p.m. UTC | #1
On 24 March 2016 at 21:30, Leo Duran <leo.duran@amd.com> wrote:
> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Leo Duran <leo.duran@amd.com>


Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


> ---

>  EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 5 ++++-

>  1 file changed, 4 insertions(+), 1 deletion(-)

>

> diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c

> index 80af8cf..f1e067c 100644

> --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c

> +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c

> @@ -139,7 +139,10 @@ InitializeRealTimeClock (

>  {

>    EFI_STATUS  Status;

>

> -  LibRtcInitialize (ImageHandle, SystemTable);

> +  Status = LibRtcInitialize (ImageHandle, SystemTable);

> +  if (EFI_ERROR (Status)) {

> +    return Status;

> +  }

>

>    SystemTable->RuntimeServices->GetTime       = GetTime;

>    SystemTable->RuntimeServices->SetTime       = SetTime;

> --

> 1.9.1

>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index 80af8cf..f1e067c 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -139,7 +139,10 @@  InitializeRealTimeClock (
 {
   EFI_STATUS  Status;
 
-  LibRtcInitialize (ImageHandle, SystemTable);
+  Status = LibRtcInitialize (ImageHandle, SystemTable);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
 
   SystemTable->RuntimeServices->GetTime       = GetTime;
   SystemTable->RuntimeServices->SetTime       = SetTime;