aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-06-04 14:16:44 +0100
committerMichael Brown <mcb30@ipxe.org>2021-06-04 14:16:44 +0100
commit065dce8d5950938a7250a93c2630c4b53d2e8293 (patch)
tree152824bd48de65141fad3644fa6ae55df4ec79e7
parentf3f568e382a5f19824b3bfc6081cde39eee661e8 (diff)
downloadipxe-065dce8d5950938a7250a93c2630c4b53d2e8293.zip
ipxe-065dce8d5950938a7250a93c2630c4b53d2e8293.tar.gz
ipxe-065dce8d5950938a7250a93c2630c4b53d2e8293.tar.bz2
[ath5k] Avoid returning uninitialised data on EEPROM read errors
Originally-implemented-by: Bernhard M. Wiedemann <bwiedemann@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/drivers/net/ath/ath5k/ath5k_eeprom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/net/ath/ath5k/ath5k_eeprom.c b/src/drivers/net/ath/ath5k/ath5k_eeprom.c
index 12519bc..46f33d1 100644
--- a/src/drivers/net/ath/ath5k/ath5k_eeprom.c
+++ b/src/drivers/net/ath/ath5k/ath5k_eeprom.c
@@ -39,6 +39,9 @@ static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data)
{
u32 status, timeout;
+ /* Avoid returning uninitialised data on error */
+ *data = 0xffff;
+
/*
* Initialize EEPROM access
*/