Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 032cfba2 authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar
Browse files

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.

Change-Id: Iadf22f3692783f29dd6e08205ceeb9981bca302c
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
parent 84606f73
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -646,8 +646,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(cid))
		return -ENOENT;

	rc = wil_cid_fill_sinfo(vif, cid, sinfo);

@@ -683,7 +683,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(cid))
		return -ENOENT;

	ether_addr_copy(mac, wil->sta[cid].addr);
+2 −2
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ static void _wil6210_disconnect_complete(struct wil6210_vif *vif,
		wil_dbg_misc(wil,
			     "Disconnect complete %pM, CID=%d, reason=%d\n",
			     bssid, cid, reason_code);
		if (cid >= 0) /* disconnect 1 peer */
		if (wil_cid_valid(cid)) /* disconnect 1 peer */
			wil_disconnect_cid_complete(vif, cid, reason_code);
	} else { /* all */
		wil_dbg_misc(wil, "Disconnect complete all\n");
@@ -456,7 +456,7 @@ static void _wil6210_disconnect(struct wil6210_vif *vif, const u8 *bssid,
		cid = wil_find_cid(wil, vif->mid, bssid);
		wil_dbg_misc(wil, "Disconnect %pM, CID=%d, reason=%d\n",
			     bssid, cid, reason_code);
		if (cid >= 0) /* disconnect 1 peer */
		if (wil_cid_valid(cid)) /* disconnect 1 peer */
			wil_disconnect_cid(vif, cid, reason_code);
	} else { /* all */
		wil_dbg_misc(wil, "Disconnect all\n");