* [PATCH] ath6kl: Fix ath6kl_bmi_read_hi32 macro
@ 2014-05-16 14:11 Frederic Danis
2014-05-28 13:52 ` Kalle Valo
0 siblings, 1 reply; 4+ messages in thread
From: Frederic Danis @ 2014-05-16 14:11 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, kvalo, Frederic Danis
tmp may be used uninitialized if ath6kl_bmi_read() returns an error.
Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
---
drivers/net/wireless/ath/ath6kl/bmi.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index 18fdd69..397a52f 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 {
(void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
- *val = le32_to_cpu(tmp); \
+ if (!ret) \
+ *val = le32_to_cpu(tmp); \
ret; \
})
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ath6kl: Fix ath6kl_bmi_read_hi32 macro
2014-05-16 14:11 [PATCH] ath6kl: Fix ath6kl_bmi_read_hi32 macro Frederic Danis
@ 2014-05-28 13:52 ` Kalle Valo
2014-06-02 12:17 ` [PATCH v2] " Frederic Danis
0 siblings, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2014-05-28 13:52 UTC (permalink / raw)
To: Frederic Danis; +Cc: linville, linux-wireless, ath6kl
Frederic Danis <frederic.danis@linux.intel.com> writes:
> tmp may be used uninitialized if ath6kl_bmi_read() returns an error.
>
> Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
> ---
> drivers/net/wireless/ath/ath6kl/bmi.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
> index 18fdd69..397a52f 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 {
> (void) (check_type == val); \
> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
> ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
> - *val = le32_to_cpu(tmp); \
> + if (!ret) \
> + *val = le32_to_cpu(tmp); \
> ret; \
> })
I see new warnings with this patch:
drivers/net/wireless/ath/ath6kl/init.c: In function '__ath6kl_init_hw_start.part.5':
drivers/net/wireless/ath/ath6kl/init.c:1196:13: warning: 'board_ext_address' may be used uninitialized in this function [-Wuninitialized]
drivers/net/wireless/ath/ath6kl/init.c:1147:21: note: 'board_ext_address' was declared here
drivers/net/wireless/ath/ath6kl/init.c:1224:6: warning: 'board_address' may be used uninitialized in this function [-Wuninitialized]
drivers/net/wireless/ath/ath6kl/init.c:1147:6: note: 'board_address' was declared here
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ath6kl: Fix ath6kl_bmi_read_hi32 macro
2014-05-28 13:52 ` Kalle Valo
@ 2014-06-02 12:17 ` Frederic Danis
2014-07-14 12:50 ` Kalle Valo
0 siblings, 1 reply; 4+ messages in thread
From: Frederic Danis @ 2014-06-02 12:17 UTC (permalink / raw)
To: kvalo; +Cc: linville, linux-wireless, ath6kl, Frederic Danis
tmp may be used uninitialized if ath6kl_bmi_read() returns an error.
Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
---
drivers/net/wireless/ath/ath6kl/bmi.h | 3 ++-
drivers/net/wireless/ath/ath6kl/init.c | 12 ++++++++++--
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 18fdd69..397a52f 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 {
(void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
- *val = le32_to_cpu(tmp); \
+ if (!ret) \
+ *val = le32_to_cpu(tmp); \
ret; \
})
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index d5ef211..6e1e699 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)
ath6kl_bmi_write_hi32(ar, hi_board_data,
board_address);
} 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 */
- 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 &&
board_ext_address == 0) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ath6kl: Fix ath6kl_bmi_read_hi32 macro
2014-06-02 12:17 ` [PATCH v2] " Frederic Danis
@ 2014-07-14 12:50 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2014-07-14 12:50 UTC (permalink / raw)
To: Frederic Danis; +Cc: ath6kl, linux-wireless, linville
Frederic Danis <frederic.danis@linux.intel.com> writes:
> tmp may be used uninitialized if ath6kl_bmi_read() returns an error.
>
> Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Thanks, applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-14 12:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 14:11 [PATCH] ath6kl: Fix ath6kl_bmi_read_hi32 macro Frederic Danis
2014-05-28 13:52 ` Kalle Valo
2014-06-02 12:17 ` [PATCH v2] " Frederic Danis
2014-07-14 12:50 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).