diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-05-20 09:04:47 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-05-28 18:55:30 +0300 |
commit | 238f5d6fc0285053a1684cbb676b9f507080633d (patch) | |
tree | 0053b6dea0c58f3a8495cec9dbf0972c0002d1a5 /drivers/net/wireless/mediatek/mt76/mt76x02.h | |
parent | ae4027a798988ba001584d77cc57e6b4cd77ddec (diff) | |
download | linux-238f5d6fc0285053a1684cbb676b9f507080633d.tar.xz |
mt76: fix per-driver wcid range checks after wcid array size bump
All drivers before MT7915 have a limit of 128 WCID entries. Stop relying
on ARRAY_SIZE(dev->mt76.wcid), since it no longer reflects that limit.
Fixes: 49e649c3e0a6 ("mt76: adjust wcid size to support new 802.11ax generation")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h index 6ea210bd3f07..4c9bbc7ce023 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h @@ -15,6 +15,7 @@ #include "mt76x02_dfs.h" #include "mt76x02_dma.h" +#define MT76x02_N_WCIDS 128 #define MT_CALIBRATE_INTERVAL HZ #define MT_MAC_WORK_INTERVAL (HZ / 10) @@ -246,7 +247,7 @@ mt76x02_rx_get_sta(struct mt76_dev *dev, u8 idx) { struct mt76_wcid *wcid; - if (idx >= ARRAY_SIZE(dev->wcid)) + if (idx >= MT76x02_N_WCIDS) return NULL; wcid = rcu_dereference(dev->wcid[idx]); |