summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-01-11 17:53:08 +0300
committerJiri Slaby <jslaby@suse.cz>2017-03-13 23:40:23 +0300
commit8a490093ed29ee5db45fb6f24d7fa696ef3f1fc0 (patch)
tree6b0b97c1a24f5d73eb6eeb97acac391a95d2bee1 /mm
parent94deca997c8bc8af8034c131581fc880250e9d81 (diff)
downloadlinux-8a490093ed29ee5db45fb6f24d7fa696ef3f1fc0.tar.xz
staging: rtl: fix possible NULL pointer dereference
commit 6e017006022abfea5d2466cad936065f45763ad1 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: 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5") Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions