[U-Boot] [PATCH 1/3] board:tricorder: always work with valid eeprom data
Andreas Bießmann
andreas.devel at googlemail.com
Thu Apr 10 12:52:50 CEST 2014
From: Andreas Bießmann <andreas.biessmann at corscience.de>
Commit 890880583d84607e36b52a785a96b167728bbf73 introduced EEPROM parsing and
board detection but faild to return a valid tricorder_eeprom struct for backup
case. When pressing S200 while reading EEPROM we ignore the value. We
returned falsely a tricorder_eeprom struct with uninitialized data which is
just garbage.
Initialize it by zeroing the whole structure.
Signed-off-by: Andreas Bießmann <andreas.biessmann at corscience.de>
Cc: Thomas Weber <thomas.weber at corscience.de>
Signed-off-by: Andreas Bießmann <andreas.devel at googlemail.com>
---
board/corscience/tricorder/tricorder.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board/corscience/tricorder/tricorder.c b/board/corscience/tricorder/tricorder.c
index 2dfcb27..9e81bf3 100644
--- a/board/corscience/tricorder/tricorder.c
+++ b/board/corscience/tricorder/tricorder.c
@@ -79,6 +79,8 @@ static void get_eeprom(struct tricorder_eeprom *eeprom)
} else {
panic("Could not get board revision\n");
}
+ } else {
+ memset(eeprom, 0, TRICORDER_EEPROM_SIZE);
}
}
--
1.7.10.4
More information about the U-Boot
mailing list