From: Dan Carpenter <error27@gmail.com>
To: shayne.chen@mediatek.com
Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [bug report] wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices
Date: Sat, 3 Dec 2022 15:55:53 +0300 [thread overview]
Message-ID: <Y4tHWWBKBU4GaMkX@kili> (raw)
Hello Shayne Chen,
The patch 98686cd21624: "wifi: mt76: mt7996: add driver for MediaTek
Wi-Fi 7 (802.11be) devices" from Nov 22, 2022, leads to the following
Smatch static checker warning:
drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c:72 mt7996_eeprom_load()
error: uninitialized symbol 'free_block_num'.
drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c
55 static int mt7996_eeprom_load(struct mt7996_dev *dev)
56 {
57 int ret;
58
59 ret = mt76_eeprom_init(&dev->mt76, MT7996_EEPROM_SIZE);
60 if (ret < 0)
61 return ret;
62
63 if (ret) {
64 dev->flash_mode = true;
65 } else {
66 u8 free_block_num;
67 u32 block_num, i;
68
69 /* TODO: check free block event */
70 mt7996_mcu_get_eeprom_free_block(dev, &free_block_num);
free_block_num is not initialized if mt7996_mcu_get_eeprom_free_block()
fails.
71 /* efuse info not enough */
--> 72 if (free_block_num >= 59)
73 return -EINVAL;
74
75 /* read eeprom data from efuse */
76 block_num = DIV_ROUND_UP(MT7996_EEPROM_SIZE, MT7996_EEPROM_BLOCK_SIZE);
77 for (i = 0; i < block_num; i++)
78 mt7996_mcu_get_eeprom(dev, i * MT7996_EEPROM_BLOCK_SIZE);
79 }
80
81 return mt7996_check_eeprom(dev);
82 }
regards,
dan carpenter
next reply other threads:[~2022-12-03 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-03 12:55 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-12-03 12:54 [bug report] wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4tHWWBKBU4GaMkX@kili \
--to=error27@gmail.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=shayne.chen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).