rtnl_is_locked() checks whether the lock is currently held by any task,
not specifically by _this_ task so it is wrong to use it in the
(un)register path.
In both of these cases, examining the call stack shows that there is no
way for rtnl_lock to be taken by the task running these functions, so
remove the checks.
Further, (un)register_netdev() have existed since the beginning of Git
history so there's no reason for a version check here and we can always
call the function that takes the lock itself and should never call the
version which expects rtnl_lock to be held.
Fix the following errors that happen on a 5.19 kernel:
error: initialization of ‘int (*)(struct wiphy *, struct net_device *, unsigned int)’
from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *)’
[-Werror=incompatible-pointer-types]
6821 | .stop_ap = cfg80211_rtw_stop_ap,
error: ‘struct wireless_dev’ has no member named ‘current_bss’
7052 | if (wdev->current_bss) {
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Based on lwfinger/rtlwifi_new/commit/2b3cb6be0aed5cbcd4318a7e63d39e499b5094c0#diff-839e3ea33b3a136b794f7a0281eead7c
Signed-off-by: John-Eric Kamps <john-eric.kamps@honeywell.com>
The driver is crashing with the following:
Unable to handle kernel NULL pointer dereference at virtual address 00000000
...
PC is at cfg80211_scan_done+0x28/0x64 [cfg80211]
LR is at cfg80211_rtw_scan+0x724/0x800 [8723ds]
The faulty statement is
cfg80211_scan_done(request, 0);
Sending a simple integer as the second argument of cfg80211_scan_done()
is only valid for kernel 4.7 and earlier.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This repository contains the Realtek driver V5.1.1.5_20523.20161209_BTCOEX20161208-1212.
At inclusion, the only changes from the Realtek version were to fix any compile
warnings or errors. With these changes, the driver builds on kernels through
4.11.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>