Skip to content

Commit

Permalink
ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
kvalo committed Mar 18, 2013
1 parent aa8705f commit 99089ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 99089ab

Please sign in to comment.