Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Leon Romanovsky
Wed, 18 Nov 2026 19:26
[PATCH v3 01/31] wifi: mac80211_hwsim: lock device for manual driver binding
Author: Leon Romanovsky
Date: Wed, 18 Nov 2026 19:26
Date: Wed, 18 Nov 2026 19:26
30 lines
9237 bytes
9237 bytes
From: Leon Romanovsky <leonro@nvidia.com>
The documented API contract for device_bind_driver() requires the device
lock. mac80211_hwsim uses it for a newly created class device with no bus,
so no automatic driver-core path can bind the device concurrently and the
missing lock was safe.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/net/wireless/virtual/mac80211_hwsim_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index e53714b81ec2c..b796da3dd54b3 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -5769,7 +5769,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
goto failed_drvdata;
}
data->dev->driver = &mac80211_hwsim_driver.driver;
+ device_lock(data->dev);
err = device_bind_driver(data->dev);
+ device_unlock(data->dev);
if (err != 0) {
pr_debug("mac80211_hwsim: device_bind_driver failed (%d)\n",
err);
--
2.56.1
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads