Commit 1c3d95ed authored by Frederic Danis's avatar Frederic Danis Committed by Kalle Valo

ath6kl: Fix ath6kl_bmi_read_hi32 macro

tmp may be used uninitialized if ath6kl_bmi_read() returns an error.
Signed-off-by: default avatarFrederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent d385623a
...@@ -242,7 +242,8 @@ struct ath6kl_bmi_target_info { ...@@ -242,7 +242,8 @@ struct ath6kl_bmi_target_info {
(void) (check_type == val); \ (void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \ addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \ ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
*val = le32_to_cpu(tmp); \ if (!ret) \
*val = le32_to_cpu(tmp); \
ret; \ ret; \
}) })
......
...@@ -1161,11 +1161,19 @@ static int ath6kl_upload_board_file(struct ath6kl *ar) ...@@ -1161,11 +1161,19 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
ath6kl_bmi_write_hi32(ar, hi_board_data, ath6kl_bmi_write_hi32(ar, hi_board_data,
board_address); board_address);
} else { } else {
ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address); ret = ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address);
if (ret) {
ath6kl_err("Failed to get board file target address.\n");
return ret;
}
} }
/* determine where in target ram to write extended board data */ /* determine where in target ram to write extended board data */
ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address); ret = ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address);
if (ret) {
ath6kl_err("Failed to get extended board file target address.\n");
return ret;
}
if (ar->target_type == TARGET_TYPE_AR6003 && if (ar->target_type == TARGET_TYPE_AR6003 &&
board_ext_address == 0) { board_ext_address == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment