From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: netdev@vger.kernel.org
Subject: Re: [bug report] net: airoha: Move DSA tag in DMA descriptor
Date: Thu, 6 Mar 2025 11:21:07 +0100 [thread overview]
Message-ID: <Z8l3E0lGOcrel07C@lore-desk> (raw)
In-Reply-To: <46c1790a-0860-4907-894e-2d8ec4622147@stanley.mountain>
[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]
On Mar 06, Dan Carpenter wrote:
> Hello Lorenzo Bianconi,
>
> Commit af3cf757d5c9 ("net: airoha: Move DSA tag in DMA descriptor")
> from Feb 28, 2025 (linux-next), leads to the following Smatch static
> checker warning:
>
> drivers/net/ethernet/airoha/airoha_eth.c:1722 airoha_get_dsa_tag()
> warn: 'dp' isn't an ERR_PTR
>
> drivers/net/ethernet/airoha/airoha_eth.c
> 1710 static u32 airoha_get_dsa_tag(struct sk_buff *skb, struct net_device *dev)
> 1711 {
> 1712 #if IS_ENABLED(CONFIG_NET_DSA)
> 1713 struct ethhdr *ehdr;
> 1714 struct dsa_port *dp;
> 1715 u8 xmit_tpid;
> 1716 u16 tag;
> 1717
> 1718 if (!netdev_uses_dsa(dev))
> 1719 return 0;
> 1720
> 1721 dp = dev->dsa_ptr;
> --> 1722 if (IS_ERR(dp))
>
> Why would this be an error pointer? Is this supposed to be a check for
> NULL?
yes, right. Moreover NULL pointer check is already done in netdev_uses_dsa() so
we can drop it. I will post a fix for it.
Regards,
Lorenzo
>
> 1723 return 0;
> 1724
> 1725 if (dp->tag_ops->proto != DSA_TAG_PROTO_MTK)
> 1726 return 0;
> 1727
> 1728 if (skb_cow_head(skb, 0))
> 1729 return 0;
> 1730
>
> regards,
> dan carpenter
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2025-03-06 10:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 9:49 [bug report] net: airoha: Move DSA tag in DMA descriptor Dan Carpenter
2025-03-06 10:21 ` 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=Z8l3E0lGOcrel07C@lore-desk \
--to=lorenzo@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=netdev@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