mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-08 18:35:20 +02:00
wifi: mt76: mt7996: use hweight16 to get correct tx antenna
[ Upstream commitf98c3de92b
] The chainmask is u16 so using hweight8 cannot get correct tx_ant. Without this patch, the tx_ant of band 2 would be -1 and lead to the following issue: BUG: KASAN: stack-out-of-bounds in mt7996_mcu_add_sta+0x12e0/0x16e0 [mt7996e] Fixes:98686cd216
("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Link: https://patch.msgid.link/20240816094635.2391-1-shayne.chen@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
818dd118f4
commit
50d87e3b70
|
@ -1412,7 +1412,7 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb,
|
||||||
{
|
{
|
||||||
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
|
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
|
||||||
struct mt7996_phy *phy = mvif->phy;
|
struct mt7996_phy *phy = mvif->phy;
|
||||||
int tx_ant = hweight8(phy->mt76->chainmask) - 1;
|
int tx_ant = hweight16(phy->mt76->chainmask) - 1;
|
||||||
struct sta_rec_bf *bf;
|
struct sta_rec_bf *bf;
|
||||||
struct tlv *tlv;
|
struct tlv *tlv;
|
||||||
const u8 matrix[4][4] = {
|
const u8 matrix[4][4] = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user