Skip to content

Commit

Permalink
staging: rtl8723bs: fix monitor netdev register/unregister
Browse files Browse the repository at this point in the history
Due to the locking changes and callbacks happening inside
cfg80211, we need to use cfg80211 versions of the register
and unregister functions if called within cfg80211 methods,
otherwise deadlocks occur.

Fixes: a05829a ("cfg80211: avoid holding the RTNL when calling the driver")
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210426212801.3d902cc9e6f4.Ie0b1e0c545920c61400a4b7d0f384ea61feb645a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed May 31, 2021
1 parent a64b6a2 commit b90f51e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *name, str
mon_wdev->iftype = NL80211_IFTYPE_MONITOR;
mon_ndev->ieee80211_ptr = mon_wdev;

ret = register_netdevice(mon_ndev);
ret = cfg80211_register_netdevice(mon_ndev);
if (ret) {
goto out;
}
Expand Down Expand Up @@ -2360,7 +2360,7 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy,
adapter = rtw_netdev_priv(ndev);
pwdev_priv = adapter_wdev_data(adapter);

unregister_netdevice(ndev);
cfg80211_unregister_netdevice(ndev);

if (ndev == pwdev_priv->pmon_ndev) {
pwdev_priv->pmon_ndev = NULL;
Expand Down

0 comments on commit b90f51e

Please sign in to comment.