]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7915: fix tlv length of mt7915_mcu_get_chan_mib_info
authorRyder Lee <ryder.lee@mediatek.com>
Wed, 26 Jul 2023 18:35:05 +0000 (02:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:02 +0000 (09:48 +0200)
[ Upstream commit 4f1875c288dfc1ccea81fc17fef1d30c9d8498b2 ]

Correct per-device TLV lengths to avoid invalid operation in firmware.
(  64.040375:28:STATS-E)statsGetSingleHWCounter: MIB counter index = 65472 not supported.
This happens on mt7916/mt7986.

Fixes: b0bfa00595be ("wifi: mt76: mt7915: improve accuracy of time_busy calculation")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

index a325066bf57e9abd13744be5e00a0ae96be0ac19..1a8611c6b684dde45a09247897cc71211656b71b 100644 (file)
@@ -3000,7 +3000,7 @@ int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)
        }
 
        ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD(GET_MIB_INFO),
-                                       req, sizeof(req), true, &skb);
+                                       req, len * sizeof(req[0]), true, &skb);
        if (ret)
                return ret;