Skip to contentSkip to conversation

wifi: mt76: mt7996: fix fortify warning

PATCH In review Felix Fietkau 2 participants 2 messages Feb 3, 2024 – Feb 5, 2024

Subsystems (2)
lore
Share & tools
lore

Felix Fietkau

author maintainer
#0 lore raw

PATCH 1/1 wifi: mt76: mt7996: fix fortify warning

Copy cck and ofdm separately in order to avoid __read_overflow2_field warning.

Fixes f75e4779d215 ("wifi: mt76: mt7996: add txpower setting support")
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +2 -1
index 3c729b563edc..699be57309c2 100644
@@ -4477,7 +4477,8 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
 
 	skb_put_data(skb, &req, sizeof(req));
 	/* cck and ofdm */
-	skb_put_data(skb, &la.cck, sizeof(la.cck) + sizeof(la.ofdm));
+	skb_put_data(skb, &la.cck, sizeof(la.cck));
+	skb_put_data(skb, &la.ofdm, sizeof(la.ofdm));
 	/* ht20 */
 	skb_put_data(skb, &la.mcs[0], 8);
 	/* ht40 */
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · Felix Fietkau

Copy cck and ofdm separately in order to avoid __read_overflow2_field warning.

Fixes f75e4779d215 ("wifi: mt76: mt7996: add txpower setting support")

Patch applied to wireless.git, thanks.

0647903efbc8 wifi: mt76: mt7996: fix fortify warning

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches