summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/pc80/rtc/mc146818rtc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index 0d36b004a6..a102917d8d 100644
--- a/src/drivers/pc80/rtc/mc146818rtc.c
+++ b/src/drivers/pc80/rtc/mc146818rtc.c
@@ -251,14 +251,14 @@ enum cb_err get_option(void *dest, const char *name)
return CB_CMOS_OPTION_NOT_FOUND;
}
- if (get_cmos_value(ce->bit, ce->length, dest) != CB_SUCCESS) {
- UNLOCK_NVRAM_CBFS_SPINLOCK();
- return CB_CMOS_ACCESS_ERROR;
- }
if (!cmos_checksum_valid(LB_CKS_RANGE_START, LB_CKS_RANGE_END, LB_CKS_LOC)) {
UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_CMOS_CHECKSUM_INVALID;
}
+ if (get_cmos_value(ce->bit, ce->length, dest) != CB_SUCCESS) {
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
+ return CB_CMOS_ACCESS_ERROR;
+ }
UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_SUCCESS;
}