wifi: mt76: mt7996: fix fortify warning
authorFelix Fietkau <nbd@nbd.name>
Sat, 3 Feb 2024 13:24:46 +0000 (14:24 +0100)
committerKalle Valo <kvalo@kernel.org>
Mon, 5 Feb 2024 18:00:45 +0000 (20:00 +0200)
Copy cck and ofdm separately in order to avoid __read_overflow2_field
warning.

Fixes: f75e4779d215 ("wifi: mt76: mt7996: add txpower setting support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240203132446.54790-1-nbd@nbd.name
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

index 3c729b563edc5dd6f964e0e72c46f276367c3d65..699be57309c2e4db6d8ff3f456d55fe5a75be291 100644 (file)
@@ -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 */