Skip to contentSkip to conversation

ath10k: Fix ath10k_bmi_read32 macro

PATCH Applied Frederic Danis 2 participants 2 messages May 16, 2014 – May 23, 2014 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix ath10k_bmi_read32 macro

tmp may be used uninitialized if ath10k_bmi_read_memory() returns an error.

---
 drivers/net/wireless/ath/ath10k/bmi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/bmi.h +2 -1
index 3a9bdf51..111ab70 100644
@@ -201,7 +201,8 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,
 									\
 		addr = host_interest_item_address(HI_ITEM(item));	\
 		ret = ath10k_bmi_read_memory(ar, addr, (u8 *)&tmp, 4); \
-		*val = __le32_to_cpu(tmp);				\
+		if (!ret)						\
+			*val = __le32_to_cpu(tmp);			\
 		ret;							\
 	 })
 
Signature · 1 line
1.7.9.5