]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mt76: mt7915: fix a signedness bug in mt7915_mcu_apply_tx_dpd()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 May 2021 14:53:59 +0000 (17:53 +0300)
committerFelix Fietkau <nbd@nbd.name>
Sat, 19 Jun 2021 07:22:43 +0000 (09:22 +0200)
"idx" needs to be signed for the error handling to work.

Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

index 76e8aa604e8b5e1ee57d6dc79040a1b1bca5c09c..ce7c55fda6cf3124416dc41bf34535247c442ad3 100644 (file)
@@ -3448,8 +3448,9 @@ int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
 {
        struct mt7915_dev *dev = phy->dev;
        struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
-       u16 total = 2, idx, center_freq = chandef->center_freq1;
+       u16 total = 2, center_freq = chandef->center_freq1;
        u8 *cal = dev->cal, *eep = dev->mt76.eeprom.data;
+       int idx;
 
        if (!(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_DPD))
                return 0;