All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: lorenzo@kernel.org
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] mt76: mt76_connac: create mcu library
Date: Thu, 11 Feb 2021 16:43:47 +0300	[thread overview]
Message-ID: <YCU0k+mAXAEYbiW4@mwanda> (raw)

Hello Lorenzo Bianconi,

The patch d0e274af2f2e: "mt76: mt76_connac: create mcu library" from
Jan 26, 2021, leads to the following static checker warning:

	drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:837 mt76_connac_mcu_add_sta_cmd()
	error: 'wtbl_hdr' dereferencing possible ERR_PTR()

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
   810  int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy,
   811                                  struct ieee80211_vif *vif,
   812                                  struct ieee80211_sta *sta,
   813                                  struct mt76_wcid *wcid,
   814                                  bool enable, int cmd)
   815  {
   816          struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
   817          struct mt76_dev *dev = phy->dev;
   818          struct wtbl_req_hdr *wtbl_hdr;
   819          struct tlv *sta_wtbl;
   820          struct sk_buff *skb;
   821  
   822          skb = mt76_connac_mcu_alloc_sta_req(dev, mvif, wcid);
   823          if (IS_ERR(skb))
   824                  return PTR_ERR(skb);
   825  
   826          mt76_connac_mcu_sta_basic_tlv(skb, vif, sta, enable);
   827          if (enable && sta)
   828                  mt76_connac_mcu_sta_tlv(phy, skb, sta, vif);
   829  
   830          sta_wtbl = mt76_connac_mcu_add_tlv(skb, STA_REC_WTBL,
   831                                             sizeof(struct tlv));
   832  
   833          wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(dev, wcid,
   834                                                    WTBL_RESET_AND_SET,
   835                                                    sta_wtbl, &skb);

if (IS_ERR(wtbl_hdr)) {
	do some cleanup?
	return PTR_ERR(wtbl_hdr);
}

   836          if (enable) {
   837                  mt76_connac_mcu_wtbl_generic_tlv(dev, skb, vif, sta, sta_wtbl,
   838                                                   wtbl_hdr);
   839                  if (sta)
   840                          mt76_connac_mcu_wtbl_ht_tlv(dev, skb, sta, sta_wtbl,
   841                                                      wtbl_hdr);
   842          }
   843  
   844          return mt76_mcu_skb_send_msg(dev, skb, cmd, true);
   845  }

regards,
dan carpenter

             reply	other threads:[~2021-02-11 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 13:43 Dan Carpenter [this message]
2021-02-11 15:25 ` [bug report] mt76: mt76_connac: create mcu library Lorenzo Bianconi

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=YCU0k+mAXAEYbiW4@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    /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 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.