summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712
AgeCommit message (Collapse)Author
2015-07-03staging: rtl8712: prevent buffer overrun in recvbuf2recvframeHaggai Eran
[ Upstream commit cab462140f8a183e3cca0b51c8b59ef715cb6148 ] With an RTL8191SU USB adaptor, sometimes the hints for a fragmented packet are set, but the packet length is too large. Allocate enough space to prevent memory corruption and a resulting kernel panic [1]. [1] http://www.spinics.net/lists/linux-wireless/msg136546.html Cc: <stable@vger.kernel.org> Signed-off-by: Haggai Eran <haggai.eran@gmail.com> ACKed-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2014-10-02staging: rtl8712: Fixed else not required after returnSarah Khan
WARNING: Else generally not required after return checkpatch.pl warning in hal_init.c Fixed by removing else Signed-off-by: Sarah Khan <sarahjmi07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02staging: rtl8712: Fix missing blank line warningMelike Yurtoglu
Fixes "Missing a blank line after declarations" checkpatch.pl warning in usb_ops_linux.c Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> 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-28staging: rtl8712: add new line after declarationsTapasweni Pathak
This patch fixes checkpatch.pl warning in hal_init.c file WARNING : Missing a blank line after declarations Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: rtl8712: fixed missing blank lineSarah Khan
WARNING : Missing a blank line after declaration checkpatch.pl warning in hal_init.c Signed-off-by: Sarah Khan <sarahjmi07@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: rtl8712: merge lines and remove unused variable for immediate returnTapasweni Pathak
This patch merge two lines in a single line if immediate return is found. Unused variables in each case were removed manually as they are no longer needed. This is done using Coccinelle. Semantic patch used for this is as follows : @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: Add space after return typeTapasweni Pathak
This patch fixes checkpatch.pl warning in file rtl871x_ioctl.h WARNING : Missing space after return type Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: Remove unnecessary parenthesesTapasweni Pathak
This patch fixes checkpatch.pl warning in files of rel8712 WARNING : Unnecessary parentheses - maybe == should be = ? Signed-off-by: Tapasweni Pathak <tapaswenipathak@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-09-23Staging: rtl8712: use kmalloc_array over kmallocTapasweni Pathak
This patch fixes checkpatch.pl warning in file rtl871x_xmit.c WARNING : prefer kmalloc_array over kmalloc with multiply Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: remove unnecessary 'out of memory' messageTapasweni Pathak
This patch fixes checkpatch.pl warning in file usb_ops_linux.c WARNING : possible unecessary 'out of memory' message Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: fixed space prohibitionTapasweni Pathak
This patch fixes checkpatch.pl warning in file rtl871x_io.h WARNING : space prohibited before semicolon Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: remove void function return; statementTapasweni Pathak
This patch fixes checkpatch.pl warning in files of rtl8712 WARNING : void function return statement are not generally useful Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: remove semicolon after macroTapasweni Pathak
This patch fixes checkpatch.pl warning in rtl871x_mp.h file WARNING : Macro should not use a trailing semicolon Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: Missing a blank line after declarationsAybuke Ozdemir
This patch fixes these warning messages found by checkpatch.pl: WARNING : Missing a blank line after declarations. Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: Remove unnecessary parentheses.Aybuke Ozdemir
This patch fixes checkpatch.pl warning Unnecessary parentheses in rtl871x_xmit.c Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: remove break after return statementTapasweni Pathak
This patch fixes checkpatch.pl warning in rtl871x_ioctl_linux.c file WARNING : break is not useful after goto or return Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-30staging:rtl8712:mlme_linux.c: Adds blank lines to pass checkpatch.plSantiago Torres
Added three newlines after variable declarations to pass checkpatch.pl. Signed-off by: Santiago Torres-Arias <torresariass@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: rtl8712: remove wrapper function thread_enter()James A Shackleford
The inline function thread_enter() accepts a single ignored parameter and is just a wrapper for allow_signal(SIGTERM). Removed. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: rtl8712: remove #define _workitem struct work_structJames A Shackleford
_workitem is just a #define for work_struct. Remove the #define and use struct work_struct directly instead. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: rtl8712: remove wrapper function _set_workitem()James A Shackleford
The inline function _set_workitem() simply wraps schedule_work(). Removed. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: rtl8712: remove wrapper function _init_workitem()James A Shackleford
The inline function _init_workitem() is just a wrapper around INIT_WORK(). Oddly, this wrapper accepts 3 parameters while INIT_WORK() only accepts 2. The third parameter is unused. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove inapplicable commentJames A Shackleford
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 _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 is_list_emptyJames A Shackleford
is_list_empty is just an inline wrapper around list_empty. This patch removes the wrapper and directly uses list_empty instead. 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-06-26staging: rtl8712: remove unused inline _RND512()James A Shackleford
Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove unused inline _RND256()James A Shackleford
Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove inline _RND128() and use round_up()James A Shackleford
Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove inline _RND8() and use round_up()James A Shackleford
Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712: replace kmalloc(..., sizeof(T))Vitaly Osipov
As suggested by Andy Shevchenko on driverdev-devel, replace v = ... sizeof(struct type_of_v) -> sizeof(*v) Based on a cocci patch along the lines of @@ type T; expression E; identifier V; @@ T *V; ... - V = kmalloc(sizeof(T), E); + V = kmalloc(sizeof(*V), E); @@ type T; expression E; identifier V; @@ T *V; ... - V = kzalloc(sizeof(T), E); + V = kzalloc(sizeof(*V), E); Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statementRickard Strandqvist
The same code regardless of the outcome of the if statement. And clean up another duplicate line of code. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712, rtl8712: avoid lots of build warningsArnd Bergmann
The rtl8712 driver has an 'extern inline' function that contains an 'if', which causes lots of warnings with CONFIG_PROFILE_ALL_BRANCHES overriding the definition of 'if': drivers/staging/rtl8712/ieee80211.h:759:229: warning: '______f' is static but declared in inline function 'ieee80211_get_hdrlen' which is not static [enabled by default] This changes the driver to use 'static inline' instead, which happens to be the correct annotation anyway. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712: Remove useless variable 'fw_found'Thomas Vegas
The net device only exists when firmware is loaded successfully. Firmware presence variable is only used through r871xu_dev_remove() and this function already checks for net device existence. Signed-off-by: Thomas Vegas <thomas@grouk.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712: Fix oops on dongle removal if firmware is not availableThomas Vegas
When firmware is not available, net device is not created. Upon disconnect, we must check for net device existence before trying to release net device private data. Signed-off-by: Thomas Vegas <thomas@grouk.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-27staging: rtl8712: return -ENOMEM instead of -1Vitaly Osipov
After the commit 91d435f replaced _malloc with kmalloc, smatch picked up a couple of new warnings. This fixes the warning: warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-27staging: rtl8712: fix kmalloc parametersVitaly Osipov
After the commit 91d435f replaced _malloc with kmalloc, smatch picked up a couple of new warnings. This fixes warnings: warn: struct type mismatch 'writePTM_parm vs setdig_parm' warn: struct type mismatch 'writePTM_parm vs setra_parm' The difference is u8 vs unsigned char. Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.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-05-24staging: rtl8712: usb_intf.c: Fix for possible null pointer dereferenceRickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: rtl8712: fix unnecessary line continuationsMarcus Farkas
This commit fixes the following checkpatch warning: rtl8712/rtl871x_security.c - 1178: WARNING: Avoid unnecessary line continuations Signed-off-by: Marcus Farkas <marcus.farkas@finitebox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: rtl8712: fix unnecessary parenthesesMarcus Farkas
This commit fixes the following checkpatch warnings: rtl8712/rtl871x_security.c - 1167: WARNING: Unnecessary parentheses - maybe == should be = ? - 1374: WARNING: Unnecessary parentheses - maybe == should be = ? Signed-off-by: Marcus Farkas <marcus.farkas@finitebox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: rtl8712: fix missing blank lines after declarationsMarcus Farkas
This commit fixes the following checkpatch warnings: rtl8712/rtl871x_security.c - 275: WARNING: Missing a blank line after declarations - 768: WARNING: Missing a blank line after declarations - 801: WARNING: Missing a blank line after declarations Signed-off-by: Marcus Farkas <marcus.farkas@finitebox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: rtl8712: fix potential leaks in r8712_set_key()Christian Engelmayer
Fix potential leaks in the error paths of r8712_set_key(). In case the algorithm specific checks fail, the function returns without enqueuing or freeing the already allocated command and parameter structs. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 144370, 144371. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()Christian Engelmayer
Fix a potential leak in the error path of r871x_wx_set_enc_ext(). In case the requested algorithm is not supported by the driver, the function returns without freeing the already allocated 'param' struct. Move the input verification to the beginning of the function so that the direct return is safe. Detected by Coverity - CID 144373. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>