File ipxe.858d2df89a2b07c97a2ef4ca919964b73fcd61b0.patch of Package qemu-2.10

From: Michael Brown <mcb30@ipxe.org>
Date: Fri, 4 Jun 2021 14:16:44 +0100
Subject: 858d2df89a2b07c97a2ef4ca919964b73fcd61b0

[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>
---
 src/drivers/net/ath/ath5k/ath5k_eeprom.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/src/drivers/net/ath/ath5k/ath5k_eeprom.c
+++ b/src/drivers/net/ath/ath5k/ath5k_eeprom.c
@@ -30,24 +30,27 @@ FILE_LICENCE ( MIT );
 
 #include "ath5k.h"
 #include "reg.h"
 #include "base.h"
 
 /*
  * Read from eeprom
  */
 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
 	 */
 	if (ah->ah_version == AR5K_AR5210) {
 		AR5K_REG_ENABLE_BITS(ah, AR5K_PCICFG, AR5K_PCICFG_EEAE);
 		(void)ath5k_hw_reg_read(ah, AR5K_EEPROM_BASE + (4 * offset));
 	} else {
 		ath5k_hw_reg_write(ah, offset, AR5K_EEPROM_BASE);
 		AR5K_REG_ENABLE_BITS(ah, AR5K_EEPROM_CMD,
 				AR5K_EEPROM_CMD_READ);
 	}
 
openSUSE Build Service is sponsored by