rtl8723ds: Fix NULL dereference error

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 commit is contained in:
Larry Finger
2017-10-14 20:29:15 -05:00
parent 452f4494cd
commit 57b8112292

View File

@@ -2281,6 +2281,11 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
#ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo;
#endif /* CONFIG_P2P */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
struct cfg80211_scan_info info = {
.aborted = 0
};
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
wdev = request->wdev;
@@ -2481,7 +2486,11 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
check_need_indicate_scan_done:
if (_TRUE == need_indicate_scan_done) {
_rtw_cfg80211_surveydone_event_callback(padapter, request);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
cfg80211_scan_done(request, &info);
#else
cfg80211_scan_done(request, 0);
#endif
}
cancel_ps_deny: