aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/core
AgeCommit message (Collapse)Author
2020-07-16Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate()Dan Carpenter
commit b65a2d8c8614386f7e8d38ea150749f8a862f431 upstream. The "ie_len" variable is in the 0-255 range and it comes from the network. If it's over NDIS_802_11_LENGTH_RATES_EX (16) then that will lead to memory corruption. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200603101958.GA1845750@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2019-05-01staging: rtl8723bs: core: Use !x in place of NULL comparison.Vatsala Narang
Avoid NULL comparison, compare using boolean operator. Issue found using coccinelle. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-01staging: rtl8723bs: core: Prefer using the BIT Macro.Vatsala Narang
Replace bit shifting on 1 with the BIT(x) macro. Issue found using coccinelle. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-30staging: rtl8723bs: Fix checkpatch.pl warningsVandana BN
This patch resolves coding style brace warning and constant on right warning. WARNING: Comparisons should place the constant on the right side of the test WARNING: braces {} are not necessary for single statement blocks CHECK: Comparison to NULL could be written "!pbuf" Signed-off-by: Vandana BN <bnvandana@gmail.com> ------ v2- Edited commit message and subject v3- Edited commit message v4- changed NULL check to use !pbuf ------ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-30staging: rtl8723bs: core: Remove blank line.Vatsala Narang
To avoid style issues, remove multiple blank lines. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-30staging: rtl8723bs: core: Remove else after return statement.Vatsala Narang
Remove else after return statement as it is not useful. Issue found using checkpatch. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-30staging: rtl8723bs: core: Remove return in void functionVatsala Narang
Remove return in void function to get rid of checkpatch warning. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-20Staging: rtl8723bs: core: Replace return typesMadhumitha Prabakaran
Remove unwanted assignments and replace return types. Issue suggested by Coccinelle. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: rtl8723bs: fix spelling mistake: "nonprintabl" -> "non-printable"Colin Ian King
There is a spelling mistake in an RT_TRACE message, fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02staging: rtl8723bs: core: Replace bit shifting with BIT macroPayal Kshirsagar
Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02Staging: rtl8723bs: core: Remove typecast in kfreeMadhumitha Prabakaran
Remove typecast in kfree, as per definition of kfree in include/linux/slab.h#L144, the parameter type of kfree is void*, and hence C compiler casts any pointer type to void*. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-01Merge 5.1-rc3 into staging-nextGreg Kroah-Hartman
We want those fixes and this resolves an erofs merge conflict. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-30staging: rtl8723bs: core: rtw_efuse.c: Compress two lines into one linePayal Kshirsagar
Challenge suggested by coccinelle. Return value directly without saving it in a variable and remove that variable. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-30staging: rtl8723bs: core: rtw_ieee80211.c: Remove unnecessary parenthesesPayal Kshirsagar
Challenge suggested by coccinelle. Remove unnecessary parentheses around expressions. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-30staging: rtl8723bs: core: rtw_mlme.c: Remove unnecessary parenthesesPayal Kshirsagar
Challenge suggested by coccinelle. Remove unnecessary parentheses around expressions. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-30staging: rtl8723bs: core: Remove unnecessary parenthesesVatsala Narang
Removes unnecessary parentheses while returning an expression.Issue found using coccinelle. Semantic patch used to solve the problem is as follows: @@ expression e; @@ return -( e -) ; Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-30staging: rtl8723bs: core: Fix a comparison warning.Vatsala Narang
Move the constant to the right side of comparison to get rid of checkpatch warning. Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-27staging: rtl8723bs: core: fix line over 80 characters warningAnirudh Rayabharam
Shorten the expression by re-using the part that was already computed to fix the line over 80 characters warning reported by checkpatch.pl. Signed-off-by: Anirudh Rayabharam <anirudh.rayabharam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-24staging: rtl8723bs: Remove function rtw_alloc_network()Nishka Dasgupta
Remove function rtw_alloc_network() as all it does is call _rtw_alloc_network(). Rename _rtw_alloc_network() to rtw_alloc_network(). Change references to _rtw_alloc_network() to refer to rtw_alloc_network(). Issue first noticed while using Coccinelle and ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-24staging: rtl8723bs: core: Remove parenthesesNishka Dasgupta
Remove unnecessary parentheses around variables. Issue found with Checkpatch. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-24staging: rtl8723bs: core: Change datatype from sint to intNishka Dasgupta
Change datatype of local variable from sint to int. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-24staging; rtl8723bs: Remove unnecessary function rtw_init_mlme_priv()Nishka Dasgupta
Remove function rtw_init_mlme_priv() as all it does is call _rtw_init_mlme_priv(). Change the name of _rtw_init_mlme_priv() to rtw_init_mlme_priv() and its return type to int. Remove references to _rtw_init_mlme_priv() from the corresponding header file. Suggestion to delete return variable from rtw_init_mlme_priv() put forward by Coccinelle using ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22staging: rtl8723bs: core: Remove return variables in rtw_mlme_ext.cNishka Dasgupta
Remove unnecessary local return variables in rtw_mlme_ext.c. Issue found with Coccinelle using ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22staging: rtl8723bs: core: Change NULL comparisons to Boolean negationNishka Dasgupta
Change NULL comparisons to Boolean negations. Issue found with Coccinelle using matchnull.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8723bs: core: Change NULL comparison to Boolean negationNishka Dasgupta
Change NULL comparison to Boolean negation. Issue found with Coccinelle using matchnull.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: rtl8188eu: Fix potential NULL pointer dereference of kcallocAditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Acked-by: Mukesh Ojha <mojha@codeaurora.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21Staging: rtl8723bs: Change return type and type of local variableMadhumitha Prabakaran
rtw_startbss_cmd can return the result of calling rtw_enqueue_cmd, which can return the result of calling _rtw_enqueue_cmd, but they all have different return types (u8, u32, and sint, respectively). As all of these functions return error codes, change all the return types to int, in preparation for converting these functions to use standard kernel error codes. Also, remove extern from the function declaration to maintain Linux kernel coding style. Issue suggested by Coccinelle. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Add missing NULL check for kmallocMadhumitha Prabakaran
Include missing NULL check for kmalloc in function rtw_init_evt_priv. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Replace NULL comparison with !Madhumitha Prabakaran
Replace NULL comparison with ! in function rtw_init_cmd_priv, to maintain Linux kernel coding style. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Change values to standard error codes in functionsMadhumitha Prabakaran
Change values for standard error codes in functions rtw_init_cmd_priv and rtw_init_evt_priv, as _SUCCESS should be 0 and _FAIL should be -ENOMEM. Also, change the values in corresponding call sites of the functions. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Remove unnecessary local variable in functionMadhumitha Prabakaran
Remove unnecessary local variable 'res' in function and replace the value directly in the return of the function. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove Dead Code in core/rtw_mlme.cEmanuel Bennici
The Functions `void rtw_surveydone_event_callback`, `void rtw_indicate_connect`, `void rtw_stadel_event_callback` and `void _rtw_join_timeout_handler` are using the Macro CONFIG_INTEL_WIDI which doesn't exists anymore. Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove unreachable Code in core/rtw_cmd.cEmanuel Bennici
The `case INTEl_WIDI_WK_CID`-Statement in Function `u8 rtw_drvextra_cmd_hdl` wouldn't be used because of CONFIG_INTEL_WIDI. Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove old unreachable CodeEmanuel Bennici
The commented code in core/rtw_mlme_ext.c obsolete because the macro CONFIG_INTEL_WIDI no longer exists. Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove Dead Code in collect_bss_info FunctionEmanuel Bennici
In `u8 collect_bss_info` is a ifdef-Preprocessor who checks CONFIG_INTEL_WIDI, since this Macro doesn't exists anymore this Patch removes the Dead Code in core/rtw_mlme_ext.c Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Change type of variables and return typeMadhumitha Prabakaran
Change type of local variables 'res' and return type of functions 'rtw_init_cmd_pri' and 'rtw_init_evt_priv', as function's return types are defined for standard error codes _SUCCESS and _FAIL. Also, change return type of functions declarations corresponding to change made in function definitions. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove wrapper functions and change function namesMadhumitha Prabakaran
Drop wrappers rtw_init_cmd_priv and rtw_init_evt_priv and remove their function declarations, as their only purpose is to call other functions. Change function names from _rtw_init_cmd_priv to rtw_init_cmd_priv, and _rtw_init_evt_priv to rtw_init_evt_priv in function definitions and function declarations. Also, remove externs in function declarations rtw_init_cmd_priv and rtw_init_evt_priv, to maintain Linux kernel coding style. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07Staging: rtl8723bs: remove some dead codeDan Carpenter
"psecnetwork" is the address of &psecuritypriv->sec_bss. Since ->sec_bss isn't the first member of the struct that means that "psecnetwork" can't be NULL. We can just remove this dead code. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-25staging: rtl8723bs: fix indentation issue with return statementColin Ian King
A return statement is indented incorrectly, fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17Staging: rtl8723bs: Fix code style issue in rtl8723bs driverHardik Singh Rathore
Add space between 'else' and '{' to solve code style issue in all the files for rtl8723bs driver. Signed-off-by: Hardik Singh Rathore <hardiksingh.k@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: remove semaphore remnantsArnd Bergmann
Nothing uses the semaphores any more in this driver, so remove all references to that type. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: change pwrctrl lock to a mutexArnd Bergmann
This semaphore is used like a mutex, so it should use the regular mutex API, as we do in the other copies of this driver. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: change semaphores to completionsArnd Bergmann
This driver uses many semaphores, most of them are equivalent to completions. The other copies of this driver got moved over to completions a while ago, so do the same here. In this usage scenario, the two are equivalent, so the behavior should not change. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: remove dead code, rtw_port_switch_chk()Michael Straube
The function rtw_port_switch_chk() returns always false. Remove the function and related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-10Merge 4.20-rc6 into staging-nextGreg Kroah-Hartman
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05Revert commit ef9209b642f "staging: rtl8723bs: Fix indenting errors and an ↵Young Xiao
off-by-one mistake in core/rtw_mlme_ext.c" pstapriv->max_num_sta is always <= NUM_STA, since max_num_sta is either set in _rtw_init_sta_priv() or rtw_set_beacon(). Fixes: ef9209b642f1 ("staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in core/rtw_mlme_ext.c") Signed-off-by: Young Xiao <YangX92@hotmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05staging: rtl8723bs: fix typo in function name rtw_sctx_chk_waring_statusColin Ian King
Trivial fix to typo in function name, rename it to rtw_sctx_chk_warning_status. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05staging: rtl8723bs: core: remove unnecessary blank linesKimberly Brown
Remove unnecessary blank lines, including multiple blank lines, blank lines after opening braces, and blank lines before closing braces, from file core/rtw_ap.c. Issues found by checkpatch. Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: rtl8723bs: core: Remove true and false comparisonMamta Shukla
Remove comparison to true and false in if statement. Issue found with checkpatch.pl. CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> ACKed-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: rtl8723bs: clean up clang warning on extraneous parenthesesColin Ian King
There are extraneous parantheses that are causing clang to produce a warning so remove these. Clean up 3 clang warnings: equality comparison with extraneous parentheses [-Wparentheses-equality] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>