[bug report] wifi: nxp: add nxpwifi driver for IW61x

Dan Carpenter <[email protected]>
Newsgroups org.kernel.vger.linux-wireless
Message-ID <[email protected]>
Hello Jeff Chen,

Commit 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") from
Jun 5, 2026 (linux-next), leads to the following Smatch static
checker warning:

	drivers/net/wireless/nxp/nxpwifi/cfg80211.c:850 nxpwifi_change_vif_to_sta()
	warn: duplicate check 'ret' (previous on line 840)

drivers/net/wireless/nxp/nxpwifi/cfg80211.c
    816 static int
    817 nxpwifi_change_vif_to_sta(struct net_device *dev,
    818                           enum nl80211_iftype curr_iftype,
    819                           enum nl80211_iftype type,
    820                           struct vif_params *params)
    821 {
    822         struct nxpwifi_private *priv;
    823         struct nxpwifi_adapter *adapter;
    824         int ret;
    825 
    826         priv = nxpwifi_netdev_get_priv(dev);
    827 
    828         if (!priv)
    829                 return -EINVAL;
    830 
    831         adapter = priv->adapter;
    832 
    833         nxpwifi_dbg(adapter, INFO,
    834                     "%s: changing role to station\n", dev->name);
    835 
    836         ret = nxpwifi_deinit_priv_params(priv);
    837         if (ret)
    838                 goto done;
    839         ret = nxpwifi_init_new_priv_params(priv, dev, type);
    840         if (ret)
    841                 goto done;
    842 
    843         update_vif_type_counter(adapter, curr_iftype, -1);
    844         update_vif_type_counter(adapter, type, 1);
    845         dev->ieee80211_ptr->iftype = type;
    846 
    847         if (nxpwifi_set_bss_mode(priv))
    848                 return -1;

Was this supposed to be?

	ret = nxpwifi_set_bss_mode(priv);

    849 
--> 850         if (ret)
    851                 goto done;

Dead code.

    852 
    853         ret = nxpwifi_sta_init_cmd(priv, false, false);
    854 
    855 done:
    856         return ret;
    857 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.