linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd()
@ 2013-03-10  5:51 Kalle Valo
  2013-03-10  5:51 ` [PATCH 2/2] ath6kl: remove false check from ath6kl_rx() Kalle Valo
  2013-03-18 11:52 ` [PATCH 1/2] ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd() Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Kalle Valo @ 2013-03-10  5:51 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

Dan reported that smatch found a possible issue in ath6kl_wmi_beginscan_cmd()
where we might access sc->supp_rates beyond the end. It shouldn't happen as
ar->wiphy->bands always have just the first two bands set, but add an extra
check just to be sure.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 31a3081..87aefb4 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2029,6 +2029,9 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
 		if (!sband)
 			continue;
 
+		if (WARN_ON(band >= ATH6KL_NUM_BANDS))
+			break;
+
 		ratemask = rates[band];
 		supp_rates = sc->supp_rates[band].rates;
 		num_rates = 0;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-18 11:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-10  5:51 [PATCH 1/2] ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd() Kalle Valo
2013-03-10  5:51 ` [PATCH 2/2] ath6kl: remove false check from ath6kl_rx() Kalle Valo
2013-03-18 11:52 ` [PATCH 1/2] ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd() 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).