Commit a380eb57 authored by Dedy Lansky's avatar Dedy Lansky Committed by Kalle Valo

wil6210: fix invalid sta statistics update

Upon status ring handling, in case there are both unicast and
multicast (cid == max) status messages to handle, wrong sta statistics
might get updated.
Fix this by setting stats to NULL upon invalid cid
(e.g. == max_assoc_sta).
Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 6d1ba32c
...@@ -1137,7 +1137,7 @@ int wil_tx_sring_handler(struct wil6210_priv *wil, ...@@ -1137,7 +1137,7 @@ int wil_tx_sring_handler(struct wil6210_priv *wil,
/* Total number of completed descriptors in all descriptor rings */ /* Total number of completed descriptors in all descriptor rings */
int desc_cnt = 0; int desc_cnt = 0;
int cid; int cid;
struct wil_net_stats *stats = NULL; struct wil_net_stats *stats;
struct wil_tx_enhanced_desc *_d; struct wil_tx_enhanced_desc *_d;
unsigned int ring_id; unsigned int ring_id;
unsigned int num_descs; unsigned int num_descs;
...@@ -1187,8 +1187,7 @@ int wil_tx_sring_handler(struct wil6210_priv *wil, ...@@ -1187,8 +1187,7 @@ int wil_tx_sring_handler(struct wil6210_priv *wil,
ndev = vif_to_ndev(vif); ndev = vif_to_ndev(vif);
cid = wil->ring2cid_tid[ring_id][0]; cid = wil->ring2cid_tid[ring_id][0];
if (cid < max_assoc_sta) stats = (cid < max_assoc_sta ? &wil->sta[cid].stats : NULL);
stats = &wil->sta[cid].stats;
wil_dbg_txrx(wil, wil_dbg_txrx(wil,
"tx_status: completed desc_ring (%d), num_descs (%d)\n", "tx_status: completed desc_ring (%d), num_descs (%d)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment