summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210/cfg80211.c
diff options
context:
space:
mode:
authorAlexei Avshalom Lazar <ailizaro@codeaurora.org>2019-06-16 10:26:03 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-06-27 20:50:28 +0300
commitc478ac9daae6f19621997250900bf4fef74d3b25 (patch)
tree58958660b83a9a9c4fbab048acf448d04e2d2807 /drivers/net/wireless/ath/wil6210/cfg80211.c
parentf2b6b46e483b9a084088853ecc4123118791829e (diff)
downloadlwn-c478ac9daae6f19621997250900bf4fef74d3b25.tar.gz
lwn-c478ac9daae6f19621997250900bf4fef74d3b25.zip
wil6210: update cid boundary check of wil_find_cid/_by_idx()
The return value of wil_find_cid()/wil_find_cid_by_idx() is validated with the lower boundary value. Check the upper boundary value as well. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/cfg80211.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/cfg80211.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index f94fe428c501..64da2be38760 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -380,8 +380,8 @@ static int wil_cfg80211_get_station(struct wiphy *wiphy,
wil_dbg_misc(wil, "get_station: %pM CID %d MID %d\n", mac, cid,
vif->mid);
- if (cid < 0)
- return cid;
+ if (!wil_cid_valid(wil, cid))
+ return -ENOENT;
rc = wil_cid_fill_sinfo(vif, cid, sinfo);
@@ -417,7 +417,7 @@ static int wil_cfg80211_dump_station(struct wiphy *wiphy,
int rc;
int cid = wil_find_cid_by_idx(wil, vif->mid, idx);
- if (cid < 0)
+ if (!wil_cid_valid(wil, cid))
return -ENOENT;
ether_addr_copy(mac, wil->sta[cid].addr);