aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712/rtl871x_recv.c
AgeCommit message (Collapse)Author
2017-03-12staging: rtl: fix possible NULL pointer dereferenceArnd Bergmann
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: spaces preferred around operandsLuis de Bethencourt
Clean up all instances of checkpatch.pl checks: CHECK: spaces preferred around that '+' (and other operands) Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: braces should be used on all armsLuis de Bethencourt
Fix all instances of the following checkpatch.pl check: CHECK: braces {} should be used on all arms of this statement Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: Remove boolean comparisonsLuis de Bethencourt
Boolean tests do not need explicit comparison to true or false. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staing: rtl8712: else after return or break warningGamze POLAT
This patch fixes checkpatch.pl warning. WARNING: else is not generally useful after a break or return Signed-off-by: Gamze POLAT <gamzepolat94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: rtl8712: remove unused variablesSudip Mukherjee
unused variables are removed. These variables were only assigned some values and after that they were never being used. So they are safe to be removed , and it has been build tested. I left a call to r8712_read32(padapter, TCR) and r8712_read8(padapter, SDIO_HCPWM) . r8712_read32() and r8712_read8() is ultimately calling usb_read32() and usb_read8() respectively. and they are again calling r8712_usbctrl_vendorreq(). this r8712_usbctrl_vendorreq() is communicating through the usb bus and is sending and receiving the control msg. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02staging: rtl8712: Fix unnecessary parentheses style warningYeliz Taneroglu
This fixes the following checkpatch.pl warning: drivers/staging/rtl8712/rtl871x_recv.c:634 warning: Unnecessary parentheses - maybe == should be = ? Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712 : Fix line over 80 charactersTapasweni Pathak
This patch fixes checkpatch.pl warning in files of rtl8712 WARNING : line over 80 characters Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function _queue_emptyJames A Shackleford
_queue_empty is an inline wrapper around list_empty. This patch removes this wrapper function and instead calls list_empty directly. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove function get_list_headJames A Shackleford
get_list_head is an inline that returns &list->head. This patch removes this inline and directly applies &list->head where applicable. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function get_nextJames A Shackleford
get_next is just an inline wrapper around return list->next. This patch removes the wrapper and directly uses list->next where applicable. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function list_deleteJames A Shackleford
list_delete is just an inline wrapper around list_del_init. This patch removes the wrapper and directly uses list_del_init. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function list_insert_tailJames A Shackleford
list_insert_tail is just an inline wrapper around list_add_tail. This patch removes the wrapper and directly uses list_add_tail. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function _init_listheadJames A Shackleford
_init_listhead is just an inline wrapper around INIT_LIST_HEAD. This patch removes the wrapper and directly uses INIT_LIST_HEAD instead. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25staging: rtl8712: remove _malloc()Vitaly Osipov
This patch removes all usage of _malloc() and the function itself. Most uses are straightforward replacements by kmalloc(..., GFP_ATOMIC), because this was the definition of _malloc(). In a few places it was possible to use kzalloc() or memdup_user. A further improvement would be to replace GFP_ATOMIC with GFP_KERNEL where possible. Verified by compilation only. Initial replacement done by running a Coccinelle script along the lines of: @@ type T; expression E; identifier V; @@ - V = (T) _malloc(E); + V = kmalloc(E, GFP_ATOMIC); @@ expression E, E1; @@ - E1 = _malloc(E); + E1 = kmalloc(E, GFP_ATOMIC); Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: r8712u: Remove useless return variablesPeter Senna Tschudin
This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // <smpl> @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret - return ret; + return C; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16staging: r8712u: Fix case where ethtype was never obtained and always be ↵Larry Finger
checked against 0 Zero-initializing ether_type masked that the ether type would never be obtained for 8021x packets and the comparison against eapol_type would always fail. Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: r8712u: use is_zero_ether_addr() instead of memcmp()Wei Yongjun
Using is_zero_ether_addr() instead of directly use memcmp(addr, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) to determine if the ethernet address is all zeros. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10staging: wean rtl8712 off of its ancient duplicate of ip.hPaul Gortmaker
This driver should not be carrying around ancient copies of headers like <linux/ip.h> for its own use. Mapping it onto the mainline one uncovers no build issues. Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-05-10staging: wean rtl8712 off of its ancient duplicate of if_ether.hPaul Gortmaker
This driver should not be carrying around ancient copies of headers like <linux/if_ether.h> for its own use. Mapping it onto the mainline one uncovers no build issues. Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-02-09staging: r8712u: Simplify semaphoresLarry Finger
I am preparing to convert this driver from semaphore to mutex locking, The first step has been to eliminate a number of semaphores that were initialized but never used, and one whose only use was a single "up" after initialization. A total of 9 semaphores were removed in this process. One other change was to remove some inline semaphore routines that were unused. In addition, several cases had the following structure: down() if () { ... } up() The locking overhead was reduced by moving the up/down inside the if block. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-09-06staging: r8712u: Tracking kmemleak false positives.Larry Finger
The frame buffers allocated in _r8712_init_recv_priv() are not tracked by kmemleak, but they are freed when the driver is unloaded. To help find any real leaks, these false positives are annotated for kmemleak. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20staging: rtl8712: fixed coding style issuesJavier M. Mellid
Fixed some style and format issues with code. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: r8712u: Fix sparse warningsLarry Finger
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-20staging: r8712u: Add the new driver to the mainline kernelLarry Finger
This code is for a completely new version of the Realtek 8192 USB devices such as the D-Link DWA-130. The Realtek code, which was originally for Linux, Windows XP and Windows CE, has been stripped of all code not needed for Linux. In addition, only one additional configuration variable, which enables AP mode, remains. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Tested-by: Frederic Leroy <fredo@starox.org>