Skip to contentSkip to conversation

drivers/net/wireless/mediatek/mt76/mt7996/main.c:952 mt7996_mac_sta_add_links() error: uninitialized symbol 'err'.

DISCUSSION kernel test robot 1 participant 1 message Apr 10, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Lorenzo Bianconi <[email protected]>
CC: Felix Fietkau <[email protected]>
CC: Bo Jiao <[email protected]>
CC: Peter Chiu <[email protected]>
CC: Shayne Chen <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3b07108ada81a8ebcebf1fe61367b4e436c895bd
commit: dd82a9e02c054052b5899872c1f32805428f6131 wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks
date:   3 weeks ago

:::::: branch date: 4 hours ago
:::::: commit date: 3 weeks ago
config: powerpc64-randconfig-r073-20250409 (https://download.01.org/0day-ci/archive/20250410/[email protected]/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

New smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7996/main.c:952 mt7996_mac_sta_add_links() error: uninitialized symbol 'err'.

Old smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7996/main.c:73 mt7996_stop_phy() warn: variable dereferenced before check 'phy' (see line 71) drivers/net/wireless/mediatek/mt76/mt7996/main.c:360 mt7996_set_monitor() warn: variable dereferenced before check 'phy' (see line 358) drivers/net/wireless/mediatek/mt76/mt7996/main.c:1133 mt7996_set_rts_threshold() error: uninitialized symbol 'ret'.

vim +/err +952 drivers/net/wireless/mediatek/mt76/mt7996/main.c

dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  923  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  924  static int
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  925  mt7996_mac_sta_add_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  926  			 struct ieee80211_sta *sta, unsigned long new_links)
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  927  {
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  928  	struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  929  	unsigned int link_id;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  930  	int err;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  931  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  932  	for_each_set_bit(link_id, &new_links, IEEE80211_MLD_MAX_NUM_LINKS) {
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  933  		struct mt7996_vif_link *link;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  934  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  935  		if (rcu_access_pointer(msta->link[link_id]))
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  936  			continue;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  937  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  938  		link = mt7996_vif_link(dev, vif, link_id);
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  939  		if (!link)
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  940  			goto error_unlink;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  941  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  942  		err = mt7996_mac_sta_init_link(dev, vif, link, sta, link_id);
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  943  		if (err)
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  944  			goto error_unlink;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  945  	}
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  946  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  947  	return 0;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  948  
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  949  error_unlink:
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  950  	mt7996_mac_sta_remove_links(dev, sta, new_links);
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11  951  

dd82a9e02c0540 Lorenzo Bianconi 2025-03-11 @952 return err;
dd82a9e02c0540 Lorenzo Bianconi 2025-03-11 953 } dd82a9e02c0540 Lorenzo Bianconi 2025-03-11 954

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki