[bug report] mt76: mt7915: add encap offload for 4-address mode stations

Dan Carpenter dan.carpenter at oracle.com
Thu Dec 10 03:41:40 EST 2020


Hello Felix Fietkau,

The patch e151d71e503d: "mt76: mt7915: add encap offload for
4-address mode stations" from Aug 21, 2020, leads to the following
static checker warning:

	drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1689 mt7915_mcu_sta_update_hdr_trans()
	error: 'wtbl_hdr' dereferencing possible ERR_PTR()

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
  1676  int mt7915_mcu_sta_update_hdr_trans(struct mt7915_dev *dev,
  1677                                      struct ieee80211_vif *vif,
  1678                                      struct ieee80211_sta *sta)
  1679  {
  1680          struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
  1681          struct wtbl_req_hdr *wtbl_hdr;
  1682          struct sk_buff *skb;
  1683  
  1684          skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, MT7915_WTBL_UPDATE_MAX_SIZE);
  1685          if (!skb)
  1686                  return -ENOMEM;
  1687  
  1688          wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, NULL, &skb);
  1689          mt7915_mcu_wtbl_hdr_trans_tlv(skb, vif, sta, NULL, wtbl_hdr);
                                                                   ^^^^^^^^

No check for if mt7915_mcu_alloc_wtbl_req() fails.

  1690  
  1691          return mt76_mcu_skb_send_msg(&dev->mt76, skb, MCU_EXT_CMD_WTBL_UPDATE,
  1692                                       true);
  1693  }

regards,
dan carpenter



More information about the Linux-mediatek mailing list