]> git.baikalelectronics.ru Git - kernel.git/commit
rtlwifi: Fix NULL dereference when PCI driver used as an AP
authorLuis Felipe Dominguez Vega <lfdominguez@nauta.cu>
Thu, 30 Jul 2015 02:11:20 +0000 (21:11 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 31 Jul 2015 06:25:35 +0000 (09:25 +0300)
commitffb4c000699652345c1199fc967a71176897f6c0
treef894a32e7768d5525bb6cc18a9bd946efd88e166
parent4d9a000582fee0b1646fb4c8a709e5c9f5a826ec
rtlwifi: Fix NULL dereference when PCI driver used as an AP

In commit ea4ea324e1ca67f5ba3e226495b6a4677eaf00bb ("rtlwifi: add support to
send beacon frame"), the mechanism for sending beacons was established. That
patch works correctly for rtl8192cu, but there is a possibility of getting
the following warnings in the PCI drivers:

WARNING: CPU: 1 PID: 2439 at net/mac80211/driver-ops.h:12
ieee80211_bss_info_change_notify+0x179/0x1d0 [mac80211]()
wlp5s0:  Failed check-sdata-in-driver check, flags: 0x0

The warning is followed by a NULL pointer dereference as follows:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000006
IP: [<ffffffffc073998e>] rtl_get_tcb_desc+0x5e/0x760 [rtlwifi]

This problem was reported at http://thread.gmane.org/gmane.linux.kernel.wireless.general/138645,
but no solution was found at that time.

The problem was also reported at https://bugzilla.kernel.org/show_bug.cgi?id=9744
and this solution was developed and tested there.

The USB driver works with a NULL final argument in the adapter_tx() callback;
however, the PCI drivers need a struct rtl_tcb_desc in that position.

Fixes: ea4ea324e1ca ("rtlwifi: add support to send beacon frame.")
Signed-off-by: Luis Felipe Dominguez Vega <lfdominguez@nauta.cu>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [3.19+]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rtlwifi/core.c