All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] wifi: wilc1000: convert list management to RCU
@ 2024-05-09 13:24 Dan Carpenter
  2024-05-09 13:33 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Carpenter @ 2024-05-09 13:24 UTC (permalink / raw)
  To: alexis.lothore; +Cc: linux-wireless

Hello Alexis Lothoré,

Commit f236464f1db7 ("wifi: wilc1000: convert list management to
RCU") from Apr 10, 2024 (linux-next), leads to the following Smatch
static checker warning:

	drivers/net/wireless/microchip/wilc1000/mon.c:236 wilc_wfi_init_mon_interface()
	warn: sleeping in atomic context

The problem is in the caller:

drivers/net/wireless/microchip/wilc1000/cfg80211.c
  1527  static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy,
  1528                                               const char *name,
  1529                                               unsigned char name_assign_type,
  1530                                               enum nl80211_iftype type,
  1531                                               struct vif_params *params)
  1532  {
  1533          struct wilc *wl = wiphy_priv(wiphy);
  1534          struct wilc_vif *vif;
  1535          struct wireless_dev *wdev;
  1536          int iftype;
  1537  
  1538          if (type == NL80211_IFTYPE_MONITOR) {
  1539                  struct net_device *ndev;
  1540  
  1541                  rcu_read_lock();
                        ^^^^^^^^^^^^^^^
The patch changes this to disable preemption.

  1542                  vif = wilc_get_vif_from_type(wl, WILC_AP_MODE);
  1543                  if (!vif) {
  1544                          vif = wilc_get_vif_from_type(wl, WILC_GO_MODE);
  1545                          if (!vif) {
  1546                                  rcu_read_unlock();
  1547                                  goto validate_interface;
  1548                          }
  1549                  }
  1550  
  1551                  if (vif->monitor_flag) {
  1552                          rcu_read_unlock();
  1553                          goto validate_interface;
  1554                  }
  1555  
  1556                  ndev = wilc_wfi_init_mon_interface(wl, name, vif->ndev);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Does a few sleeping allocations.

  1557                  if (ndev) {
  1558                          vif->monitor_flag = 1;
  1559                  } else {
  1560                          rcu_read_unlock();
  1561                          return ERR_PTR(-EINVAL);
  1562                  }
  1563  
  1564                  wdev = &vif->priv.wdev;
  1565                  rcu_read_unlock();
  1566                  return wdev;
  1567          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-05-28  9:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 13:24 [bug report] wifi: wilc1000: convert list management to RCU Dan Carpenter
2024-05-09 13:33 ` Dan Carpenter
2024-05-13 14:16 ` Alexis Lothoré
2024-05-14  8:54   ` Dan Carpenter
2024-05-14  8:59     ` Alexis Lothoré
2024-05-28  9:31 ` Alexis Lothoré
2024-05-28  9:44   ` Kalle Valo
2024-05-28  9:57     ` Alexis Lothoré

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.