ath10k: fix ath10k_bmi_read32 macro
authorFrederic Danis <frederic.danis@linux.intel.com>
Fri, 23 May 2014 08:04:49 +0000 (11:04 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 23 May 2014 08:29:23 +0000 (11:29 +0300)
tmp may be used uninitialized if ath10k_bmi_read_memory() returns
an error.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/bmi.h

index 3a9bdf51c96a212bb98166e42b7f292179c999cf..111ab701465c0e2dfa731b3e5409278151545a3a 100644 (file)
@@ -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;                                                    \
         })