From: Leon Romanovsky 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 --- 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.0