[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z8l3E0lGOcrel07C@lore-desk>
Date: Thu, 6 Mar 2025 11:21:07 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: netdev@...r.kernel.org
Subject: Re: [bug report] net: airoha: Move DSA tag in DMA descriptor
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
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists