From: Dan Carpenter <dan.carpenter@linaro.org>
To: alexis.lothore@bootlin.com
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] wifi: wilc1000: convert list management to RCU
Date: Thu, 9 May 2024 16:24:39 +0300 [thread overview]
Message-ID: <3b46ec7c-baee-49fd-b760-3bc12fb12eaf@moroto.mountain> (raw)
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
next reply other threads:[~2024-05-09 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 13:24 Dan Carpenter [this message]
2024-05-09 13:33 ` [bug report] wifi: wilc1000: convert list management to RCU 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é
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=3b46ec7c-baee-49fd-b760-3bc12fb12eaf@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=alexis.lothore@bootlin.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 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.