aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorFrederic Danis <frederic.danis@linux.intel.com>2014-06-02 14:19:46 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2014-07-14 08:49:23 -0400
commit1c3d95edf026c6fb446f53913c61ff1036c469cd (patch)
tree957787e08270916c6cc7e2331d1fc55767238b81 /drivers/net/wireless/ath
parentd385623a78145889692074c170ecac7232e547ab (diff)
ath6kl: Fix ath6kl_bmi_read_hi32 macro
tmp may be used uninitialized if ath6kl_bmi_read() returns an error. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath6kl/bmi.h3
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index 18fdd69e1f71..397a52f2628b 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.h
+++ b/drivers/net/wireless/ath/ath6kl/bmi.h
@@ -242,7 +242,8 @@ struct ath6kl_bmi_target_info {
242 (void) (check_type == val); \ 242 (void) (check_type == val); \
243 addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \ 243 addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
244 ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \ 244 ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
245 *val = le32_to_cpu(tmp); \ 245 if (!ret) \
246 *val = le32_to_cpu(tmp); \
246 ret; \ 247 ret; \
247 }) 248 })
248 249
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index d5ef211f261c..6e1e6995a634 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1161,11 +1161,19 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
1161 ath6kl_bmi_write_hi32(ar, hi_board_data, 1161 ath6kl_bmi_write_hi32(ar, hi_board_data,
1162 board_address); 1162 board_address);
1163 } else { 1163 } else {
1164 ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address); 1164 ret = ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address);
1165 if (ret) {
1166 ath6kl_err("Failed to get board file target address.\n");
1167 return ret;
1168 }
1165 } 1169 }
1166 1170
1167 /* determine where in target ram to write extended board data */ 1171 /* determine where in target ram to write extended board data */
1168 ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address); 1172 ret = ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address);
1173 if (ret) {
1174 ath6kl_err("Failed to get extended board file target address.\n");
1175 return ret;
1176 }
1169 1177
1170 if (ar->target_type == TARGET_TYPE_AR6003 && 1178 if (ar->target_type == TARGET_TYPE_AR6003 &&
1171 board_ext_address == 0) { 1179 board_ext_address == 0) {