aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_mlme.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-16staging: rtl8712: remove unnecessary NULL checkHimadri Pandya1-2/+0
List wlan_network is built properly with init_list_head and list_add_tail which cancels out its probability of being NULL because of the precence of list_head at the top of this structure. Hence, the NULL test can be omitted. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02staging: rtl8712: rtl871x_mlme.c: use !x in place of NULL comparisonPayal Kshirsagar1-4/+4
Challenge suggested by coccinelle. Avoid NULL comparison, compare using boolean operator. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8712: rename bSurpriseRemoved to surprise_removedHimadri Pandya1-3/+3
- Rename structure field bSurprisedRemoved to surprised_removed to avoid camelcase. Suggested by checkpatch. - Change type to bool as the variable is used as a boolean. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8712: rename bDriverStopped to driver_stoppedHimadri Pandya1-3/+3
- Rename structure field bDriverStopped to driver_stopped to avoid camelcase. Suggested by checkpatch. - Change type to bool as the variable is being used as boolean. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: rtl8712: clean up various indentation and coding style issuesColin Ian King1-1/+1
There are several statements that are indented incorrectly so fix these. Also remove unnecessary { } braces and clean up a comment. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05staging: rtl8712: Fix possible buffer overrunYoung Xiao1-1/+1
In commit 8b7a13c3f404 ("staging: r8712u: Fix possible buffer overrun") we fix a potential off by one by making the limit smaller. The better fix is to make the buffer larger. This makes it match up with the similar code in other drivers. Fixes: 8b7a13c3f404 ("staging: r8712u: Fix possible buffer overrun") Signed-off-by: Young Xiao <YangX92@hotmail.com> Cc: stable <stable@vger.kernel.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03staging: rtl8712: add SPDX identifiersMichael Straube1-13/+1
This satisfies a checkpatch warning and is the preferred method for notating the license. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19staging: rtl8712: make unsigned length for rtl8717_get{_wpa_, _wpa2_, _}ieStefano Manni1-1/+2
Fixed r8712_get_ie, r8712_get_wpa_ie, r8712_get_wpa2_ie to have a length as unsigned int pointer instead of signed. Sparse warnings: drivers/staging/rtl8712/rtl871x_ioctl_linux.c:173:27: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8712/rtl871x_ioctl_linux.c:173:27: expected signed int *len drivers/staging/rtl8712/rtl871x_ioctl_linux.c:173:27: got unsigned int *<noident> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:613:35: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8712/rtl871x_ioctl_linux.c:613:35: expected signed int *len drivers/staging/rtl8712/rtl871x_ioctl_linux.c:613:35: got unsigned int *<noident> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1411:67: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1411:67: expected signed int *len drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1411:67: got unsigned int *<noident> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1992:33: warning: incorrect type in argument 2 (different signedness) drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1992:33: expected int *rsn_ie_len drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1992:33: got unsigned int *<noident> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1998:33: warning: incorrect type in argument 2 (different signedness) drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1998:33: expected int *rsn_ie_len drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1998:33: got unsigned int *<noident> drivers/staging/rtl8712/rtl871x_mlme.c:1701:59: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8712/rtl871x_mlme.c:1701:59: expected signed int *len drivers/staging/rtl8712/rtl871x_mlme.c:1701:59: got unsigned int *<noident> Signed-off-by: Stefano Manni <stefano.manni@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21staging: rtl8712: style fix multiple line dereferencesMartin Homuth1-6/+3
This patch fixes various coding style issues in the rtl8712 module as noted by checkpatch.pl related to dereferencing over multiple lines. It fixes the following checkpatch.pl warning: WARNING: Avoid multiple line dereference - prefer %s Signed-off-by: Martin Homuth <martin@martinhomuth.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8712: Fix unbalanced braces around else statementLiam Ryan1-2/+2
Fix checkpath-reported unbalanced braces in the following areas 221: FILE: drivers/staging/rtl8712/hal_init.c:221: 392: FILE: drivers/staging/rtl8712/os_intfs.c:392: 363: FILE: drivers/staging/rtl8712/rtl8712_cmd.c:363: 889: FILE: drivers/staging/rtl8712/rtl8712_recv.c:889: 902: FILE: drivers/staging/rtl8712/rtl871x_cmd.c:902: 84: FILE: drivers/staging/rtl8712/rtl871x_ioctl_set.c:84: 580: FILE: drivers/staging/rtl8712/rtl871x_mlme.c:580: 593: FILE: drivers/staging/rtl8712/usb_intf.c:593: Signed-off-by: Liam Ryan <liamryandev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix Sparse warnings in rtl871x_mlme.cLarry Finger1-5/+4
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_mlme.c drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: expected unsigned int [unsigned] [usertype] DSConfig drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: expected unsigned int [unsigned] [usertype] ATIMWindow drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: expected restricted __le16 [addressable] [usertype] cap_info drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: got int Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed u32 to __le32Jannik Becher1-8/+7
Fixed sparse warnings. Deleted cpu_to_le32() for enum. I'm not sure why it was there. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21Staging: rtl8712: rtl871x_*: Removed unnecessary else statements after a break or returnShiva Kerdel1-2/+2
The indent code blocks of the else statements were unnecessary and are better written without them. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: rtl8712: Fix coding style warnings on Block commentsVijai Kumar K1-17/+13
Fixed checkpatch.pl warnings related to Block comments in staging/rtl8712/*.c files. Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: rtl8712: checkpatch cleanup: block comments using a trailing */Raphaël Beamonte1-10/+20
Fix checkpatch.pl warning "Block comments use a trailing */ on a separate line" on multiple files of the driver by editing the affected comments. Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: rtl8712: use container_of() instead of LIST_CONTAINOR()Geliang Tang1-6/+6
This patch drops the local definition of LIST_CONTAINOR(), and uses container_of() instead of it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: rtl8712: rtl871x_mlme: Clean up tests if NULL returned on failureBhaktipriya Shridhar1-2/+2
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: rtl8712: Remove unnecessary else after returnBhaktipriya Shridhar1-2/+1
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: rtl8712: Clean up tests if NULL returned on failureBhumika Goyal1-3/+3
Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as their return value on failure. !x is generally preferred over x==NULL or NULL==x so make use of !x if the value returned on failure by these functions is NULL. Done using coccinelle: @@ expression e; statement S; @@ e = \(kmalloc\|devm_kzalloc\|kmalloc_array \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...); - if(e==NULL) + if(!e) S Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: rtl8712: use list_first_entry_or_null()Geliang Tang1-8/+7
Use list_first_entry_or_null() instead of list_empty() + LIST_CONTAINOR() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: rtl8712: rtl871x_mlme: Remove wrapper functionAmitoj Kaur Chawla1-7/+1
Remove wrapper function free_network_nolock() that can be replaced by a single line of code. This patch renames _free_network_nolock() function to free_network_nolock(). Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: Replace kmalloc with kmalloc_arrayCristina Moraru1-2/+2
Replace kmalloc with specialized function kmalloc_array when the size is a multiplication of: number_of_elements * size_of_element Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: rtl8712: spaces preferred around operandsLuis de Bethencourt1-20/+20
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 Bethencourt1-11/+18
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 Bethencourt1-39/+38
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-09-29staging: rtl8712: remove dead codeLuis de Bethencourt1-1/+1
The while() loop will only exit in a return or a goto ask_for_joinbss, which means it will never break and execute the return after it. Removing return _FAIL since it is dead code. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07staging: rtl8712: rename functionJoshua Clayton1-8/+8
Rename r8712_get_ndis_wlan_bssid_ex_sz() to r8712_get_wlan_bssid_ex_sz(), which corresponds to the struct whose size it measures. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07staging: rtl8712: remove duplicate structJoshua Clayton1-12/+11
struct ndis_wlan_bssid_ex is a doppelganger of struct wlan_bssid_ex, and is used about a third as often. Switch all instances to wlan_bssid_ex, and remove ndis_wlan_bssid_ex This also gets rid of a use of typedef NDIS_802_11_RATES_EX Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07staging: rtl8712: fix buggy size calculationJoshua Clayton1-11/+1
r8712_get_ndis_wlan_bssid_ex_sz has a "6 * sizeof(unsigned long)" where the underlying struct has a 6 * unsigned char. Simplify the calculation by just subtracting the variable part from the size of the struct. This also gets rid of a use of typedef NDIS_802_11_RATES_EX Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: rtl8712: fix stack dumpSudip Mukherjee1-3/+3
del_timer_sync() is not to be called in the interrupt context unless the timer is irqsafe. but most of the functions where commits 6501c8e7d86cca5f and 382d020f4459cd77 touched were called in interrupt context. And as a result the WARN_ON was getting triggered. Changed to del_timer() in places which were called from interrupt. Fixes: 382d020f4459cd77 ("Staging: rtl8712: Eliminate use of _cancel_timer" Fixes: 6501c8e7d86cca5f ("Staging: rtl8712: Eliminate use of _cancel_timer_ex") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=97711 Reported-by: Arek Rusniak <arek.rusi@gmail.com> Tested-by: Arek Rusniak <arek.rusi@gmail.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8712: fix potential null pointer dereferenceMatteo Semenzato1-0/+2
Check if kmalloc succeded before using the pointer in memcpy. Signed-off-by: Matteo Semenzato <mattew8898@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8712: remove else after return statementHaneen Mohammed1-11/+9
else after return generally is not useful. This patch removes else after return statement. Issue addressed by checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8712: Eliminate use of _cancel_timerVaishali Thakkar1-6/+2
Use timer API function del_timer_sync instead of driver specific function _cancel_timer as besides deactivating a timer, it also ensures that the timer is stopped on all CPUs before the driver exists. Also, variables timer_cancelled and bool are removed as they are no longer needed. @a@ expression x; identifier y; @@ - _cancel_timer (&x, &y); + del_timer_sync (&x); @@type T; identifier a.y;@@ - T y; ...when != y Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8712: Eliminate use of _cancel_timer_exVaishali Thakkar1-1/+1
Use timer API function del_timer_sync instead of driver specific function _cancel_timer_ex as besides deactivating a timer, it ensures that the timer is stopped on all CPUs before the driver exists. Also, definition of function _cancel_timer_ex is removed as it is no longer needed after this change. This is done using Coccinelle and semantic patch used for this is as follows: @@ expression x; @@ - _cancel_timer_ex (&x); + del_timer_sync (&x); Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: rtl8712: Eliminate use of _set_timerVaishali Thakkar1-6/+8
This patch introduces the use of API function mod_timer instead of driver specific function _set_timer as it is a more efficient and standard way to update the expire field of an active timer. Also, definition of function _set_timer is removed as it is no longer needed after this change. Here, these cases are handled using Coccinelle and semantic patch used for this is as follows: @@ expression x; expression y;@@ - _set_timer (&x, y); + mod_timer (&x, jiffies + msecs_to_jiffies (y)); Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17staging: rtl8712: remove spaces before commasMax Perepelitsyn1-2/+2
checkpatch.pl fix for ERROR: space prohibited before that ',' (ctx:WxE) Signed-off-by: Max Perepelitsyn <mperepelitsyn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: rtl8712: remove unused variablesSudip Mukherjee1-16/+7
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-20staging: rtl8712: Remove unnecessary cast for argument of kfreeTapasweni Pathak1-2/+2
This patch removes all occurrences of unnecessary cast on the argument to kfree, all over in rtl8712. There is no need of the cast on the argument to kfree. Greped to find occurrences. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: rtl8712: Remove unnecessary parenthesesTapasweni Pathak1-1/+1
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-06-26staging: rtl8712: remove wrapper function _queue_emptyJames A Shackleford1-2/+2
_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 Shackleford1-6/+6
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 Shackleford1-11/+11
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 Shackleford1-3/+3
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 Shackleford1-4/+4
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 Shackleford1-3/+3
_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-19staging: rtl8712: replace kmalloc(..., sizeof(T))Vitaly Osipov1-4/+4
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-05-25staging: rtl8712: remove _malloc()Vitaly Osipov1-10/+7
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 Tschudin1-2/+1
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: fix potential leaks in r8712_set_key()Christian Engelmayer1-8/+20
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>
2013-11-25staging r8712u: Remove useless netdev_info slowly polluting dmesgAlexandre Demers1-3/+0
Remove useless netdev_info slowly flooding dmesg. Fixes bug https://bugzilla.kernel.org/show_bug.cgi?id=64231 Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>