From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [bug report] mt76: mt76_connac: create mcu library
Date: Thu, 11 Feb 2021 16:25:17 +0100 [thread overview]
Message-ID: <YCVMXXgPFp6/ZLC/@lore-desk> (raw)
In-Reply-To: <YCU0k+mAXAEYbiW4@mwanda>
[-- Attachment #1: Type: text/plain, Size: 2586 bytes --]
> Hello Lorenzo Bianconi,
Hi Dan,
>
> 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);
> }
I think this is a false positive since reviewing
mt76_connac_mcu_alloc_wtbl_req(), it can return ERR_PTR(-ENOMEM) only if nskb
is NULL and it is not the case.
Regards,
Lorenzo
>
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2021-02-11 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 13:43 [bug report] mt76: mt76_connac: create mcu library Dan Carpenter
2021-02-11 15:25 ` Lorenzo Bianconi [this message]
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=YCVMXXgPFp6/ZLC/@lore-desk \
--to=lorenzo@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox