All of lore.kernel.org
 help / color / mirror / Atom feed
* [nbd168-wireless:mt76 33/45] drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:286 __mt76_connac_mcu_alloc_sta_req() error: we previously assumed 'wcid' could be null (see line 281)
@ 2024-02-04 11:09 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-02-04 11:09 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Shayne Chen <shayne.chen@mediatek.com>
CC: Felix Fietkau <nbd@nbd.name>

tree:   https://github.com/nbd168/wireless mt76
head:   9f806d96c7054c92c1e0c0005a16d80e124964b7
commit: cbc8d409f650e3e275059888f766af70a0a0ba51 [33/45] wifi: mt76: connac: set correct muar_idx for mt799x chipsets
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: i386-randconfig-141-20240204 (https://download.01.org/0day-ci/archive/20240204/202402041909.mUA4dToD-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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 <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202402041909.mUA4dToD-lkp@intel.com/

smatch warnings:
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:286 __mt76_connac_mcu_alloc_sta_req() error: we previously assumed 'wcid' could be null (see line 281)

vim +/wcid +286 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  274  
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  275  struct sk_buff *
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  276  __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  277  				struct mt76_wcid *wcid, int len)
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  278  {
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  279  	struct sta_req_hdr hdr = {
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  280  		.bss_idx = mvif->idx,
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26 @281  		.muar_idx = wcid ? mvif->omac_idx : 0,
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  282  		.is_tlv_append = 1,
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  283  	};
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  284  	struct sk_buff *skb;
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  285  
cbc8d409f650e3 Shayne Chen      2024-01-26 @286  	if (is_mt799x(dev) && !wcid->sta)
cbc8d409f650e3 Shayne Chen      2024-01-26  287  		hdr.muar_idx = 0xe;
cbc8d409f650e3 Shayne Chen      2024-01-26  288  
67aa27431c7f87 Lorenzo Bianconi 2021-01-28  289  	mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo,
67aa27431c7f87 Lorenzo Bianconi 2021-01-28  290  				     &hdr.wlan_idx_hi);
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  291  	skb = mt76_mcu_msg_alloc(dev, NULL, len);
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  292  	if (!skb)
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  293  		return ERR_PTR(-ENOMEM);
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  294  
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  295  	skb_put_data(skb, &hdr, sizeof(hdr));
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  296  
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  297  	return skb;
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  298  }
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  299  EXPORT_SYMBOL_GPL(__mt76_connac_mcu_alloc_sta_req);
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  300  

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [nbd168-wireless:mt76 33/45] drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:286 __mt76_connac_mcu_alloc_sta_req() error: we previously assumed 'wcid' could be null (see line 281)
@ 2024-02-05  6:28 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-02-05  6:28 UTC (permalink / raw)
  To: oe-kbuild, Shayne Chen; +Cc: lkp, oe-kbuild-all, Felix Fietkau

tree:   https://github.com/nbd168/wireless mt76
head:   9f806d96c7054c92c1e0c0005a16d80e124964b7
commit: cbc8d409f650e3e275059888f766af70a0a0ba51 [33/45] wifi: mt76: connac: set correct muar_idx for mt799x chipsets
config: i386-randconfig-141-20240204 (https://download.01.org/0day-ci/archive/20240204/202402041909.mUA4dToD-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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 <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202402041909.mUA4dToD-lkp@intel.com/

smatch warnings:
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:286 __mt76_connac_mcu_alloc_sta_req() error: we previously assumed 'wcid' could be null (see line 281)

vim +/wcid +286 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  275  struct sk_buff *
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  276  __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  277  				struct mt76_wcid *wcid, int len)
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  278  {
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  279  	struct sta_req_hdr hdr = {
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  280  		.bss_idx = mvif->idx,
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26 @281  		.muar_idx = wcid ? mvif->omac_idx : 0,
                                                                            ^^^^
"wcid" can be NULL

d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  282  		.is_tlv_append = 1,
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  283  	};
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  284  	struct sk_buff *skb;
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  285  
cbc8d409f650e3 Shayne Chen      2024-01-26 @286  	if (is_mt799x(dev) && !wcid->sta)
                                                                               ^^^^^^^^^
Unchecked dereference

cbc8d409f650e3 Shayne Chen      2024-01-26  287  		hdr.muar_idx = 0xe;
cbc8d409f650e3 Shayne Chen      2024-01-26  288  
67aa27431c7f87 Lorenzo Bianconi 2021-01-28  289  	mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo,
67aa27431c7f87 Lorenzo Bianconi 2021-01-28  290  				     &hdr.wlan_idx_hi);
e2c93b68cb5444 Lorenzo Bianconi 2021-12-19  291  	skb = mt76_mcu_msg_alloc(dev, NULL, len);
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  292  	if (!skb)
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  293  		return ERR_PTR(-ENOMEM);
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  294  
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  295  	skb_put_data(skb, &hdr, sizeof(hdr));
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  296  
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  297  	return skb;
d0e274af2f2e44 Lorenzo Bianconi 2021-01-26  298  }

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-05  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 11:09 [nbd168-wireless:mt76 33/45] drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:286 __mt76_connac_mcu_alloc_sta_req() error: we previously assumed 'wcid' could be null (see line 281) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-02-05  6:28 Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.