2021-08-27 07:30:00

by Ryder Lee

[permalink] [raw]
Subject: [PATCH] mt76: mt7915: fix 'nrates' is uninitialized when used here

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2105:3: warning:
variable 'nrates' is uninitialized when used here [-Wuninitialized]

Fixes: 48469214f50c ("mt76: mt7915: rework .set_bitrate_mask() to support more options")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 8141a42b2d0b..4e6d9e20cc00 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -2092,7 +2092,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
struct cfg80211_bitrate_mask *mask = &mvif->bitrate_mask;
enum nl80211_band band = chandef->chan->band;
struct sta_phy phy = {};
- int ret, nrates;
+ int ret, nrates = 0;

#define __sta_phy_bitrate_mask_check(_mcs, _gi, _he) \
do { \
--
2.29.2