summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu
AgeCommit message (Collapse)Author
2017-06-07net: Fix inconsistent teardown and release of private netdev state.David S. Miller
Network devices can allocate reasources and private memory using netdev_ops->ndo_init(). However, the release of these resources can occur in one of two different places. Either netdev_ops->ndo_uninit() or netdev->destructor(). The decision of which operation frees the resources depends upon whether it is necessary for all netdev refs to be released before it is safe to perform the freeing. netdev_ops->ndo_uninit() presumably can occur right after the NETDEV_UNREGISTER notifier completes and the unicast and multicast address lists are flushed. netdev->destructor(), on the other hand, does not run until the netdev references all go away. Further complicating the situation is that netdev->destructor() almost universally does also a free_netdev(). This creates a problem for the logic in register_netdevice(). Because all callers of register_netdevice() manage the freeing of the netdev, and invoke free_netdev(dev) if register_netdevice() fails. If netdev_ops->ndo_init() succeeds, but something else fails inside of register_netdevice(), it does call ndo_ops->ndo_uninit(). But it is not able to invoke netdev->destructor(). This is because netdev->destructor() will do a free_netdev() and then the caller of register_netdevice() will do the same. However, this means that the resources that would normally be released by netdev->destructor() will not be. Over the years drivers have added local hacks to deal with this, by invoking their destructor parts by hand when register_netdevice() fails. Many drivers do not try to deal with this, and instead we have leaks. Let's close this hole by formalizing the distinction between what private things need to be freed up by netdev->destructor() and whether the driver needs unregister_netdevice() to perform the free_netdev(). netdev->priv_destructor() performs all actions to free up the private resources that used to be freed by netdev->destructor(), except for free_netdev(). netdev->needs_free_netdev is a boolean that indicates whether free_netdev() should be done at the end of unregister_netdevice(). Now, register_netdevice() can sanely release all resources after ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit() and netdev->priv_destructor(). And at the end of unregister_netdevice(), we invoke netdev->priv_destructor() and optionally call free_netdev(). Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-28staging: rtl8188eu: embedded function name style fixesIan Chard
Replace a couple of function names embedded in trace messages with __func__. One of them had a typo anyway. Signed-off-by: Ian Chard <ian@chard.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()Dan Carpenter
The "len" could be as low as -14 so we should check for negatives. Fixes: 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: rtl8188eu: fix sparse signedness warnings in rtw_generate_ieAishwarya Pant
Changed the type of wpa_ie_len from (int *) to (unsigned int *) in the function rtw_get_wpa_ie(..) to suppress signedness mismatch warnings in rtw_generate_ie of the type- drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60: warning: incorrect type in argument 2 (different signedness) drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60: expected int *wpa_ie_len drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60: got unsigned int *<noident> Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: rtl8188eu: fix sparse signedness warnings in rtw_set_ieAishwarya Pant
Changed the type of sz from (int) to (unsigned int) to suppress signedness mismatch warnings of the type- drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97: warning: incorrect type in argument 5 (different signedness) drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97: expected unsigned int [usertype] *frlen drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97: got int *<noident> Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: rtl8188eu: fix sparse signedness warnings in rtw_get_ieAishwarya Pant
Changed the type of len from (int *) to (unsigned int *) in the function rtw_get_ie(..) and wherever this function is called to suppress signedness mismatch warnings of the type- drivers/staging/rtl8188eu//core/rtw_ap.c:78:60: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8188eu//core/rtw_ap.c:78:60: expected int *len drivers/staging/rtl8188eu//core/rtw_ap.c:78:60: got unsigned int *<noident> Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-11staging: rtl8188eu: force driver to be built as a moduleHans de Goede
The rtl8188eu driver defines a ton of global symbols which tend to conflict with other realtek wifi drivers, force it to be built as a module. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: remove sw_encrypt member of security_priv structIvan Safonov
sw_encrypt always is 0. Replace sw_encrypt with 0. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: remove software_encrypt member of registry_priv structIvan Safonov
Value of this variable does not changed after initialization. Replace software_encrypt with its default value. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: replace rtw_software_encrypt with its default valueIvan Safonov
rtw_software_encrypt used only once and does not changed. Replace it with 0. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: remove sw_decrypt member of security_priv structIvan Safonov
sw_decrypt always is 0, so replace it with 0. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: remove software_decrypt member of registry_priv structIvan Safonov
Value of this variable has no changes, and used once. Replace software_decrypt with its value. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging:r8188eu: replace rtw_software_decrypt with its valueIvan Safonov
rtw_software_decrypt used only once and does not changed. Replace it with 0. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: rtl8188eu: Remove extra spacesAlfonso Lima Astor
Coding style problem detected by checkpatch.pl ERROR: space prohibited before that ',' Signed-off-by: Alfonso Lima Astor <alfonsolimaastor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: rtl8188eu: Macros with complex values should be enclosed in parenthesesAlfonso Lima Astor
This macro is not used and also had a style error. I have run grep and compiled the module to be sure. Signed-off-by: Alfonso Lima Astor <alfonsolimaastor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging:r8188eu: add iv length to frame data offsetIvan Safonov
If this frame contains IV/ICV fields, ether_type field located a little farther. This bug already fixed here: https://github.com/lwfinger/rtl8188eu/blob/master/core/rtw_recv.c#L569 . Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: rtl8188eu: removed blank lines coding style problemAndrii Vladyka
Fix 'multiple blank lines' coding style problem reported by checkpatch.pl. Signed-off-by: Andrii Vladyka <tulup@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: rtl8188eu: fix some inverted conditionsDan Carpenter
We converted these conditions from == NULL and != NULL but messed up and inverted some. Fixes: e31447f934d3 ("staging: rtl8188eu: Replace x==NULL by !x") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: rtl8188eu: Fix redundant space coding style issueAlex Yashchenko
Signed-off-by: Alex Yashchenko <alexhoppus111@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: rtl8188eu: fix typos in macrosSebastian Haas
Rename macro definition and usage to represent correct spelling of DEFAULT: ODM_REG_RX_DEFUALT_A_11N => ODM_REG_RX_DEFAULT_A_11N ODM_REG_RX_DEFUALT_B_11N => ODM_REG_RX_DEFAULT_B_11N Signed-off-by: Sebastian Haas <sehaas@deebas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: rtl8188eu: fix typos in commentsSebastian Haas
Fix typos reported by checkpatch.pl Signed-off-by: Sebastian Haas <sehaas@deebas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:rtl8188eu Add spaces around binary operatorGeorgiana Rodica Chelu
Add spaces around binary operator '&' in order to increase the readability of the code. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: replace explicit NULL comparisonGargi Sharma
Replace explicit NULL comparison with ! operator to simplify code. Found with Coccinelle script: @@ expression ptr; position p; statement s0; @@ ptr@p = \(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\| alloc_netdev\|dev_alloc_skb\)(...) ... when != ptr if ( ( + ! ptr - == NULL ) ) s0 Signed-off-by: Gargi Sharma <gs051095@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Fixed "Missing a blank line after declarations".Yamanappagouda Patil
Fixed checkpatch.pl "missing a blank line after declarations" waring messages from rtl8188eu module. Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Add a blank lineGargi Sharma
Add a blank line after function declaration to fix the checkpatch issue Please use a blank line after function/struct/union/enum declarations. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Remove multiple blank linesGargi Sharma
Remove blank lines to fix the checkpatch issue, don't use multiple blank lines. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Remove unnecessary blank linesGargi Sharma
Remove unnecessary blank lines to fix the checkpatch issue, blank lines are not required before '}'. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Put constant on right side of comparisonGargi Sharma
Constants should be on the right side of comparisons. Issue found by checkpatch.pl script. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Fix block comments warningGargi Sharma
Align * on each line and move final */ to a new line, to conform to the kernel coding style for block comments. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: rtl8188eu: Replace x==NULL by !xGargi Sharma
Replace x==NULL by !x, to fix the checkpatch issue comparsion with NULL could be written as !x. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: remove unused MCS_rate_2R arrayIvan Safonov
MCS_rate_2R[] does not used. Remove it. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: remove unused HW_VAR_RF_TYPE parameter of HT_caps_handlerIvan Safonov
rtw_hal_get_hwreg() does not used with HW_VAR_RF_TYPE parameter. Remove HW_VAR_RF_TYPE switch case in rtw_hal_get_hwreg and definition. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor HT_caps_handler() - remove rtw_hal_get_hwreg() callIvan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor HT_caps_handler(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor rtw_update_ht_cap() - remove rtw_hal_get_hwreg() callIvan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_update_ht_cap(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor issue_assocreq() - remove rtw_hal_get_hwreg() callIvan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor issue_assocreq(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor rtw_get_cur_max_rate() - remove ↵Ivan Safonov
rtw_hal_get_hwreg() call rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_get_cur_max_rate(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor rtw_check_beacon_data() - remove ↵Ivan Safonov
rtw_hal_get_hwreg() call rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_check_beacon_data(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: refactor add_RATid() - remove rtw_hal_get_hwreg() callIvan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor add_RATid(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:r8188eu: use DIV_ROUND_UP() in rtw_signal_stat_timer_hdl()Ivan Safonov
DIV_ROUND_UP macro is shorter and look better than if-else construction. DIV_ROUND_UP used in rtw_signal_stat_timer_hdl(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to ↵Ingo Molnar
<linux/sched/signal.h> We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/signal.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-02-14Staging: rtl8188eu: core/rtw_led.c: format line to reduce it below 80 charactersShishir Kulkarni
Fixes checkpatch.pl warning: "WARNING: line over 80 characters" Signed-off-by: Shishir Kulkarni <shishir.kulkarni.2307@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging:r8188eu: replace recv_frame->rx_(data|len|tail) with ↵Ivan Safonov
pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)() recv_frame->rx_(data|len|tail) duplicate pkt (skb) data|len|tail members and require special functions recvframe_(put|pull|pull_tail)() instead of skb_(put|pull|trim). Replace rx_(data|len|tail) with pkt->(data|len|tail), remove rx_(data|len|tail) and remove recvframe_(put|pull|pull_tail)(). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging:r8188eu: update pkt->(data|tail|len) synchronously with ↵Ivan Safonov
rx_(data|tail|len) in recv_frame structure Original driver code uses rx_* members to store skb (pkt) fields (instead of pkt->* members), pkt->* updated only after data completely formed, not in process. Update pkt->* after data buffer changed (with rx_*). Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging:r8188eu: remove unused rtw_ieee80211_bar structure definitionIvan Safonov
rtw_ieee80211_bar structure definition does not used. Remove it. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging:r8188eu: replace rx_end member of recv_frame with pkt->endIvan Safonov
rx_end is duplication of pkt->end pointer. pkt->end is preferred, because it is native skb field supported by skb_*() functions. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)Martin Karamihov
This is checkpatch fix for hal/bb_cfg.c file: remove not necessary braces {} Signed-off-by: Martin Karamihov <martinowar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-27staging: rtl8188eu: Fix coding style issuesWilliam Blough
Convert leading spaces to tabs Signed-off-by: William Blough <devel@blough.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-23Staging: rtl8188eu: os_dep: usb_ops_linux.c - style fixDerek Robson
Fixed comparison, moved the constant to the right side of the test Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: rtl8188eu: core: Remove NULL test before vfreeShyam Saini
vfree frees the virtually continuous block of memory beginning at addr. If addr is NULL, no operation is performed. So, NULL test is not needed before vfree(). Signed-off-by: Shyam Saini <mayhs11saini@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: rtl8188eu: fix type sign of len in rtw_get_bcn_infoPierre-Yves Kerbrat
len was declared unsigned int where we use an int Fix sparse (-Wtypesign) issues: drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1081:88: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1081:88: expected int *len drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1081:88: got unsigned int *<noident> drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1091:86: warning: incorrect type in argument 3 (different signedness) drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1091:86: expected int *len drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1091:86: got unsigned int *<noident> Signed-off-by: Pierre-Yves Kerbrat <pkerbrat@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>