linux/drivers/staging
Arnd Bergmann 272d60bfce staging: rtl: fix possible NULL pointer dereference
commit 6e01700602 upstream.

gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
a destination argument that an earlier function call may have set to NULL:

staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]

I'm fixing this by adding a NULL pointer check and returning failure
from the function, which is hopefully already handled properly.

This seems to date back to when the drivers were originally added,
so backporting the fix to stable seems appropriate. There are other
related realtek drivers in the kernel, but none of them contain a
function with a similar name or produce this warning.

Fixes: 1cc18a22b9 ("staging: r8188eu: Add files for new driver - part 5")
Fixes: 2865d42c78 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12 06:37:25 +01:00
..
android
board
clocking-wizard
comedi staging: comedi: dt282x: tidy up register bit defines 2017-01-12 11:22:50 +01:00
dgap
dgnc
emxx_udc
fbtft Staging: fbtft: Fix bug in fbtft-core 2016-10-07 15:23:47 +02:00
fsl-mc
fwserial
gdm72xx
gdm724x
goldfish
gs_fpgaboot
iio staging: iio: ad7606: fix improper setting of oversampling pins 2017-01-12 11:22:48 +01:00
lustre lustre: remove unused declaration 2016-09-15 08:27:52 +02:00
media
most
mt29f_spinand
netlogic
nvec staging: nvec: remove managed resource from PS2 driver 2016-11-18 10:48:35 +01:00
octeon
octeon-usb
olpc_dcon
panel
rdma
rtl8188eu staging: rtl: fix possible NULL pointer dereference 2017-03-12 06:37:25 +01:00
rtl8192e
rtl8192u
rtl8712 staging: rtl: fix possible NULL pointer dereference 2017-03-12 06:37:25 +01:00
rtl8723au
rts5208
skein
slicoss
sm750fb
speakup
ste_rmi4
unisys
vme
vt6655
vt6656
wilc1000
wlan-ng
xgifb
Kconfig
Makefile
staging.c