Martin Kaiser [Sun, 18 Sep 2022 17:56:56 +0000 (19:56 +0200)]
staging: r8188eu: update status before wps success blinking
Always update the status variables in rtw_led_control when we start
blinking to show that wps was successful. The if statements are not
necessary.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220918175700.215170-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 18 Sep 2022 17:56:55 +0000 (19:56 +0200)]
staging: r8188eu: cancel blink_work during wps stop
We can always cancel blink_work during wps_stop. The blinking pattern will
be updated to show that wps was successful. Another worker will be started
for this.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220918175700.215170-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nathan Huckleberry [Wed, 14 Sep 2022 21:16:06 +0000 (14:16 -0700)]
staging: r8188eu: Fix return type of rtw_xmit_entry
The ndo_start_xmit field in net_device_ops is expected to be of type
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition.
The return type of rtw_xmit_entry should be changed from int to
netdev_tx_t.
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Cc: llvm@lists.linux.dev
Reported-by: Dan Carpenter <error27@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Link: https://lore.kernel.org/r/20220914211606.423959-1-nhuck@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiaoke Wang [Tue, 13 Sep 2022 13:24:05 +0000 (21:24 +0800)]
staging: r8188eu: fix potential memory leak in _rtw_init_xmit_priv()
In _rtw_init_xmit_priv(), there are several error paths for allocation
failures just jump to the `exit` section. However, there is no action
will be performed, so the allocated resources are not properly released,
which leads to various memory leaks.
To properly release them, this patch unifies the error handling code and
several error handling paths are added.
According to the allocation sequence, if the validation fails, it will
jump to its corresponding error tag to release the resources.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_DB57E4F270F4539485C32B05FDAF8394310A@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiaoke Wang [Mon, 12 Sep 2022 02:50:26 +0000 (10:50 +0800)]
staging: r8188eu: add kfree() on an error path of rtw_xmit_resource_alloc()
In rtw_xmit_resource_alloc(), if usb_alloc_urb() fails, then the memory
`pxmitbuf->pallocated_buf` which is allocated by kzalloc() is not properly
released before returning.
So this patch adds kfree() on the above error path to release it in time.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_3B46EE3287288555389AD2EC3F388827B306@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 17:49:33 +0000 (19:49 +0200)]
staging: r8188eu: remove recv_osdep.h
The functions _rtw_init_recv_priv(), _rtw_free_recv_priv() and
rtw_recv_entry() are defined in rtw_recv.c. Move their prototypes from
recv_osdep.h to rtw_recv.h.
Move the last two remaining prototypes netdev_open() and netdev_close()
from recv_osdep.h to osdep_intf.h. That is a more appropriate place and
we can remove recv_osdep.h.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911174933.3784-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 17:49:32 +0000 (19:49 +0200)]
staging: r8188eu: remove unused prototypes from recv_osdep.h
The function prototypes rtw_recv_returnpacket(), rtw_init_recv_priv()
and rtw_free_recv_priv() are not used. Remove them.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911174933.3784-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 17:49:31 +0000 (19:49 +0200)]
staging: r8188eu: make _netdev_open() static
The function _netdev_open() is only used in os_intfs.c.
Make it static.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911174933.3784-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:49 +0000 (18:19 +0200)]
staging: r8188eu: replace tabs with space in odm_query_rxpwrpercentage()
In statements spaces should be used not tabs. Replace tabs withs spaces
in two return statements in odm_query_rxpwrpercentage().
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:48 +0000 (18:19 +0200)]
staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage()
Rename the variable 'AntPower' in odm_query_rxpwrpercentage() to avoid
camel case.
AntPower -> antpower
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:47 +0000 (18:19 +0200)]
staging: r8188eu: rename odm_QueryRxPwrPercentage()
Rename odm_QueryRxPwrPercentage() to avoid camel case.
odm_QueryRxPwrPercentage -> odm_query_rxpwrpercentage
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:46 +0000 (18:19 +0200)]
staging: r8188eu: remove unnecessary initialization
The variable 'retsig' in odm_signal_scale_mapping() is set in the
function before it returns, so it is not needed to initialize it.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:45 +0000 (18:19 +0200)]
staging: r8188eu: clean up camel case in odm_signal_scale_mapping()
Rename variables in odm_signal_scale_mapping() to avoid camel case.
CurrSig -> currsig
RetSig -> retsig
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 11 Sep 2022 16:19:44 +0000 (18:19 +0200)]
staging: r8188eu: rename odm_SignalScaleMapping()
Rename odm_SignalScaleMapping() to avoid camel case.
odm_SignalScaleMapping -> odm_signal_scale_mapping
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220911161949.11293-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:22 +0000 (16:51 +0200)]
staging: r8188eu: update status before link blinking
Always update the status variables in rtw_led_control when we start link
blinking. The if statements are not necessary.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:21 +0000 (16:51 +0200)]
staging: r8188eu: cancel blink_work before link blinking
Cancel blink_work before we start link blinking. Another worker will be
scheduled after the state variables are updated.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:20 +0000 (16:51 +0200)]
staging: r8188eu: simplify the code to prevent link blinking restart
The blinking code to signal that a link is up has the same big if clause
around it as most other blink events.
Revert this if condition and exit if we're already blinking to show that
the link is up.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:19 +0000 (16:51 +0200)]
staging: r8188eu: update status before scan blinking
Always update the status variables in rtw_led_control when we start tx/rx
blinking. The if statements are not necessary.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:18 +0000 (16:51 +0200)]
staging: r8188eu: cancel blink_work before tx/rx blinking
Cancel blink_work before we start tx/rx blinking. Another worker will be
scheduled after the state variables are updated.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:17 +0000 (16:51 +0200)]
staging: r8188eu: simplify the code to prevent tx/rx blinking restart
The code for tx/rx blinking is wrapped into a big if clause to prevent
restarting if tx/rx blinking is already running.
Revert the if condition and exit if tx/rx blinking is running. This does
not change the behaviour.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:16 +0000 (16:51 +0200)]
staging: r8188eu: update status before scan blinking
Always update the status variables in rtw_led_control when we start scan
blinking. The if statements are not necessary.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:15 +0000 (16:51 +0200)]
staging: r8188eu: cancel blink_work before scan blinking
Cancel blink_work before we start scan blinking. Another worker will be
scheduled after the state variables are updated.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 11 Sep 2022 14:51:14 +0000 (16:51 +0200)]
staging: r8188eu: simplify the code to prevent scan blinking restart
The code for scan blinking is wrapped into a big if clause to prevent
restarting if scan blinking is already running.
Revert the if condition and exit if scan blinking is running. This does
not change the behaviour.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220911145122.15444-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiaoke Wang [Fri, 9 Sep 2022 11:45:57 +0000 (19:45 +0800)]
staging: r8188eu: fix a potential memory leak in rtw_init_cmd_priv()
In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated
in failure, then `pcmdpriv->cmd_allocated_buf` will not be properly
released. Besides, considering there are only two error paths and the
first one can directly return, we do not need to implicitly jump to the
`exit` tag to execute the error handling code.
So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error
path to release the resource and simplified the return logic of
rtw_init_cmd_priv(). As there is no proper device to test with, no
runtime testing was performed.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_1B6AAE10471D4556788892F8FF3E4812F306@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nathan Huckleberry [Wed, 14 Sep 2022 21:10:57 +0000 (14:10 -0700)]
staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow
The ndo_start_xmit field in net_device_ops is expected to be of type
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition.
The return type of cvm_oct_xmit and cvm_oct_xmit_pow should be changed
from int to netdev_tx_t.
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Cc: llvm@lists.linux.dev
Reported-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Link: https://lore.kernel.org/r/20220914211057.423617-1-nhuck@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Liu Shixin [Thu, 22 Sep 2022 14:25:48 +0000 (22:25 +0800)]
staging: pi433: use DEFINE_SHOW_ATTRIBUTE to simplify pi433_debugfs_regs
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20220922142548.3248951-1-liushixin2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nathan Huckleberry [Wed, 14 Sep 2022 21:07:50 +0000 (14:07 -0700)]
staging: rtl8192u: Fix return type of ieee80211_xmit
The ndo_start_xmit field in net_device_ops is expected to be of type
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition.
The return type of ieee80211_xmit should be changed from int to
netdev_tx_t.
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Cc: llvm@lists.linux.dev
Reported-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Link: https://lore.kernel.org/r/20220914210750.423048-1-nhuck@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Mon, 12 Sep 2022 17:04:31 +0000 (19:04 +0200)]
staging: vt6655: fix some erroneous memory clean-up loops
In some initialization functions of this driver, memory is allocated with
'i' acting as an index variable and increasing from 0. The commit in
"Fixes" introduces some clean-up codes in case of allocation failure,
which free memory in reverse order with 'i' decreasing to 0. However,
there are some problems:
- The case i=0 is left out. Thus memory is leaked.
- In case memory allocation fails right from the start, the memory
freeing loops will start with i=-1 and invalid memory locations will
be accessed.
One of these loops has been fixed in commit
c8ff91535880 ("staging:
vt6655: fix potential memory leak"). Fix the remaining erroneous loops.
Link: https://lore.kernel.org/linux-staging/Yx9H1zSpxmNqx6Xc@kadam/
Fixes:
5341ee0adb17 ("staging: vt6655: check for memory allocation failures")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220912170429.29852-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Thu, 22 Sep 2022 12:23:10 +0000 (21:23 +0900)]
staging: rtl8723bs: Add a blank line after declarations
This patch adds a blank line in order to fix checkpatch warning
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220922122310.3379711-5-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Thu, 22 Sep 2022 12:23:09 +0000 (21:23 +0900)]
staging: rtl8723bs: Make switch and case at the same indent
This patch fixes switch and case as linux kernel coding style
and amend this error generated by checkpatch:
ERROR: switch and case should be at the same indent
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220922122310.3379711-4-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Thu, 22 Sep 2022 12:23:08 +0000 (21:23 +0900)]
staging: rtl8723bs: Relocate constant on the right side of test
This patch fixes following warning generated by checkpatch:
WARNING: Comparisons should place the constant on the right side of the test
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220922122310.3379711-3-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Thu, 22 Sep 2022 12:23:07 +0000 (21:23 +0900)]
staging: rtl8723bs: replace code indent as tabs
This patch removes error below generated by checkpatch
ERROR: code indent should use tabs where possible
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220922122310.3379711-2-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Mon, 19 Sep 2022 13:34:08 +0000 (22:34 +0900)]
staging: rtl8723bs: Fix coding style issue in block comment
This patch removes the following warning generated by checkpatch.pl
WARNING: Block comments use * on subsequent lines
#206: FILE: rtw_recv.c:206:
+/*
+signed int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue)
WARNING: Block comments use * on subsequent lines
#216: FILE: rtw_recv.c:216:
+/*
+caller : defrag ; recvframe_chk_defrag in recv_thread (passive)
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220919133408.3271462-1-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Sat, 17 Sep 2022 18:16:20 +0000 (03:16 +0900)]
staging: rtl8723bs: Insert blank line after declarations
This patch fixes checkpatch warning as follows:
WARNING: Missing a blank line after declarations
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220917181620.3237192-1-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kang Minchul [Tue, 13 Sep 2022 16:25:10 +0000 (01:25 +0900)]
staging: rtl8723bs: remove braces in single statement blocks
This commit cleans up checkpatch warning as follows:
WARNING: braces {} are not necessary for single statement blocks
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Link: https://lore.kernel.org/r/20220913162510.3134430-1-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiaoke Wang [Fri, 9 Sep 2022 11:27:21 +0000 (19:27 +0800)]
staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated
in failure, then `pcmdpriv->cmd_allocated_buf` will be not properly
released. Besides, considering there are only two error paths and the
first one can directly return, so we do not need implicitly jump to the
`exit` tag to execute the error handler.
So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error
path to release the resource and simplified the return logic of
rtw_init_cmd_priv(). As there is no proper device to test with, no runtime
testing was performed.
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_2B7931B79BA38E22205C5A09EFDF11E48805@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xiaoke Wang [Fri, 9 Sep 2022 10:39:35 +0000 (18:39 +0800)]
staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()
In rtw_init_drv_sw(), there are various init functions are called to
populate the padapter structure and some checks for their return value.
However, except for the first one error path, the other five error paths
do not properly release the previous allocated resources, which leads to
various memory leaks.
This patch fixes them and keeps the success and error separate.
Note that these changes keep the form of `rtw_init_drv_sw()` in
"drivers/staging/r8188eu/os_dep/os_intfs.c". As there is no proper device
to test with, no runtime testing was performed.
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_C3B899D2FC3F1BC827F3552E0B0734056006@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:58 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in rtl819x_BAProc.c, ...
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Remove multiline macro as it is not needed anymore and not liked by
kernel community.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2c41e6856cd37b4f3e5cb1108272bcc24032bf64.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:48 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in rtl_ps.c
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/6d942ba65f62643af2ff7104911f7947cca21790.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:40 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in rtl_dm.c
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/bc0e2c9551ccf78fe388b27d18576b5bb195e2f7.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:31 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in r8192E_phy.c
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/7315b22f54d62c5b56e8b9284426eca4cb641f77.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:23 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in r8192E_dev.c
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/425e1b015c34ddb6df425bc516df64c40a70a58a.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sat, 17 Sep 2022 04:25:07 +0000 (06:25 +0200)]
staging: rtl8192e: Remove ftrace-like logging in r8192E_firmware.c, ...
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/370f47919a69f2f1717f50123c1617cabc78ceca.1663387785.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shang XiaoJing [Tue, 20 Sep 2022 13:51:45 +0000 (21:51 +0800)]
staging: fwserial: Switch to kfree_rcu() API
Instead of invoking a synchronize_rcu() to free a pointer after a grace
period, we can directly make use of a new API that does the same but in
a more efficient way.
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220920135145.1387-1-shangxiaojing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gaosheng Cui [Sun, 11 Sep 2022 09:42:55 +0000 (17:42 +0800)]
staging: wlan-ng: remove unused p80211wext_handler_def declaration
p80211wext_handler_def has been removed since
commit
cb3126e60ffc ("Staging: wlan-ng: Switch from wext
to cfg80211"), so remove it.
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20220911094255.3225461-1-cuigaosheng1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:47:29 +0000 (12:47 +0200)]
staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx
Rename function MACvSetCurrAC0DescAddrEx to vt6655_mac_set_curr_ac_0...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary declaration of function and make function static. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/dc3f83dfa8b83a02ed95da3cfb71c0139ba8b674.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:47:22 +0000 (12:47 +0200)]
staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx
Rename function MACvSetCurrTx0DescAddrEx to vt6655_mac_set_curr_tx_0_...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary declaration of function and make function static. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/4337deed83e1443ebf93c5591e17f5c6dfe0cf55.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:47:15 +0000 (12:47 +0200)]
staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr
Rename function MACvSetCurrTXDescAddr to vt6655_mac_set_curr_tx_desc_addr
and iTxType to tx_type to avoid CamelCase which is not accepted by
checkpatch.pl. Remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/88dcbac76f6bad8b4eb68a3cb37cd4f9684294a0.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:47:07 +0000 (12:47 +0200)]
staging: vt6655: Rename function MACvSetCurrRx1DescAddr
Rename function MACvSetCurrRx1DescAddr to vt6655_mac_set_curr_rx_1_desc...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/0d11f588d4746988478521d323ab49e6a0b7f8b0.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:46:57 +0000 (12:46 +0200)]
staging: vt6655: Rename function MACvSetCurrRx0DescAddr
Rename function MACvSetCurrRx0DescAddr to vt6655_mac_set_curr_rx_0_desc...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/14f7f2b06ba9f8656d91d4cb84c363e190095049.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:46:35 +0000 (12:46 +0200)]
staging: vt6655: Rename function MACbSafeStop
Rename function MACbSafeStop to vt6655_mac_safe_stop to avoid CamelCase
which is not accepted by checkpatch.pl. Remove unnecessary declaration
of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/5c91b281dfab75e5ccf13413232ec993a8056af8.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:46:23 +0000 (12:46 +0200)]
staging: vt6655: Rename function MACbSafeTxOff
Rename function MACbSafeTxOff to vt6655_mac_safe_tx_off to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/50211bbdd866be93fe9ea912a433e56460bf7f28.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:46:15 +0000 (12:46 +0200)]
staging: vt6655: Rename function MACbSafeRxOff
Rename function MACbSafeRxOff to vt6655_mac_safe_rx_off to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/0cbcc7205e943393e2873839116d5ffcfb9d3d00.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:46:04 +0000 (12:46 +0200)]
staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
Rename function MACbSafeSoftwareReset to vt6655_mac_save_soft_reset and
abyTmpRegData to tmp_reg_data to avoid CamelCase which is not accepted by
checkpatch.pl. Remove return value bRetVal as it is unused by the calling
functions. Remove unnecessary declaration of function and make function
static. Change declaration of tmp_reg_data to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/540a684266610f7618b3ef6000d4699d065c8e6f.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:45:53 +0000 (12:45 +0200)]
staging: vt6655: Cleanup and rename function MACvRestoreContext
Rename function MACvRestoreContext to vt6655_mac_restore_context to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static. Change declaration of
cxt_buf to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/3d215bbf1675fd093c9b31fbf3b29ce09432ab27.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:45:42 +0000 (12:45 +0200)]
staging: vt6655: Cleanup and rename function MACvSaveContext
Rename function MACvSaveContext to vt6655_mac_save_context to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static. Change declaration of
cxt_buf to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f514711695f1eafde9996edcc246da2adcd5f9c5.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 11 Sep 2022 10:45:29 +0000 (12:45 +0200)]
staging: vt6655: Cleanup and rename function MACvSetLoopbackMode
Rename function MACvSetLoopbackMode to vt6655_mac_set_loopback_mode and
byLoopbackMode to loopback_mode to avoid CamelCase which is not accepted
by checkpatch.pl. Remove unnecessary declaration of function and made
function static. Change declaration of loopback_mode to shorten code and
remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/02ce61620e13eb7fd24833e59a288f52bf5b9730.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:22:14 +0000 (21:22 +0200)]
staging: rtl8192e: Rename CurSlotTime
Rename variable CurSlotTime to cur_slot_time to avoid CamelCase which is
not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/1b71366d87b2b178fcd8f182127a51c7a7507936.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:22:05 +0000 (21:22 +0200)]
staging: rtl8192e: Rename bHwRadioOff
Rename variable bHwRadioOff to hw_radio_off to avoid CamelCase which is
not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/bb977791e835310e51e9c38cc5c547e0b8a35e0c.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:56 +0000 (21:21 +0200)]
staging: rtl8192e: Rename RFChangeInProgress
Rename variable RFChangeInProgress to rf_change_in_progress to avoid
CamelCase which is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/29739986e76750395941ddaa6c4f0ffab6eb26a9.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:46 +0000 (21:21 +0200)]
staging: rtl8192e: Rename RFWaitCounter
Rename variable RFWaitCounter to rf_wait_counter to avoid CamelCase which
is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/11acf28a0b9f56dde4fa4fbd74a085cf2fa1c20d.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:35 +0000 (21:21 +0200)]
staging: rtl8192e: Rename rtState
Rename variable rtState to rt_state to avoid CamelCase which
is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e888fa7e6edaa68e741236ea012f8230f6817882.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:20 +0000 (21:21 +0200)]
staging: rtl8192e: Rename bConnectBySSID
Rename variable bConnectBySSID to connect_by_ssid to avoid CamelCase which
is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2b193be93598348994b1f890b6dc5c2ffb84a9b6.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:11 +0000 (21:21 +0200)]
staging: rtl8192e: Rename bActionAllowed
Rename variable bActionAllowed to action_allowed to avoid CamelCase which
is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e8b617ab58c360bb485cb51d080a8ef81cd47869.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Fri, 9 Sep 2022 19:21:03 +0000 (21:21 +0200)]
staging: rtl8192e: Rename ChangeSource
Rename variable ChangeSource to change_source to avoid CamelCase which
is not accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/0d934bb707510692ccd161ea6034b69133aac14c.1662402870.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 10 Sep 2022 18:02:36 +0000 (20:02 +0200)]
staging: r8188eu: rtw_is_scan_deny is always false
The rtw_is_scan_deny macro returns false. Remove the macro and resulting
dead code.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220910180236.489808-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 10 Sep 2022 18:02:35 +0000 (20:02 +0200)]
staging: r8188eu: remove rtw_clear_scan_deny
The rtw_clear_scan_deny macro is empty. Remove it.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220910180236.489808-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 10 Sep 2022 18:02:34 +0000 (20:02 +0200)]
staging: r8188eu: remove rtw_set_scan_deny_timer_hdl
Remove the rtw_set_scan_deny_timer_hdl macro, it's not used.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220910180236.489808-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 10 Sep 2022 18:02:33 +0000 (20:02 +0200)]
staging: r8188eu: remove empty rtw_set_scan_deny macro
The rtw_set_scan_deny macro does nothing. Remove it.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220910180236.489808-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 9 Sep 2022 14:13:39 +0000 (16:13 +0200)]
staging: vt6655: fix potential memory leak
In function device_init_td0_ring, memory is allocated for member
td_info of priv->apTD0Rings[i], with i increasing from 0. In case of
allocation failure, the memory is freed in reversed order, with i
decreasing to 0. However, the case i=0 is left out and thus memory is
leaked.
Modify the memory freeing loop to include the case i=0.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220909141338.19343-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 9 Sep 2022 10:02:32 +0000 (12:02 +0200)]
staging: r8188eu: make c2h_evt_read() static
The function c2h_evt_read() is only used in rtw_cmd.c.
Make it static.
This addresses the TODO item:
* Remove the HAL layer and migrate its functionality into the relevant
parts of the driver.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220909100232.8305-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 9 Sep 2022 10:06:51 +0000 (12:06 +0200)]
staging: vt6655: remove unnecessary null check
Remove null check for priv->tx0_bufs, because it can never be null at
this point.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220909100650.44609-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
GUO Zihua [Fri, 9 Sep 2022 08:20:48 +0000 (16:20 +0800)]
staging: rtl8723bs: Fix return type for implementation of ndo_start_xmit
CFI (Control Flow Integrity) is a safety feature allowing the system to
detect and react should a potential control flow hijacking occurs. In
particular, the Forward-Edge CFI protects indirect function calls by
ensuring the prototype of function that is actually called matches the
definition of the function hook.
Since Linux now supports CFI, it will be a good idea to fix mismatched
return type for implementation of hooks. Otherwise this would get
cought out by CFI and cause a panic.
Use enums from netdev_tx_t as return value instead. Then change return
type to netdev_tx_t.
Fixes:
cf68fffb66d6 ("add support for Clang CFI")
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220909082048.14486-3-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
GUO Zihua [Fri, 9 Sep 2022 08:20:47 +0000 (16:20 +0800)]
staging: rtl8723bs: Delete un-necessary return for _rtw_xmit_entry()
As _rtw_xmit_entry() would always return 0, we are save to delete the
return value for it.
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220909082048.14486-2-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
GUO Zihua [Mon, 5 Sep 2022 13:00:53 +0000 (21:00 +0800)]
staging: rtl8192e: Fix return type for implementation of ndo_start_xmit
CFI (Control Flow Integrity) is a safety feature allowing the system to
detect and react should a potential control flow hijacking occurs. In
particular, the Forward-Edge CFI protects indirect function calls by
ensuring the prototype of function that is actually called matches the
definition of the function hook.
Since Linux now supports CFI, it will be a good idea to fix mismatched
return type for implementation of hooks. Otherwise this would get
cought out by CFI and cause a panic.
Use enums from netdev_tx_t as return value instead, then change return
type to netdev_tx_t. Note that rtllib_xmit_inter() would return 1 only
on allocation failure and the queue is stopped if that happens, meeting
the documented requirement if NETDEV_TX_BUSY should be returned by
ndo_start_xmit.
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220905130053.10731-1-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
GUO Zihua [Mon, 5 Sep 2022 13:02:30 +0000 (21:02 +0800)]
staging: rtl8712: Fix return type for implementation of ndo_start_xmit
CFI (Control Flow Integrity) is a safety feature allowing the system to
detect and react should a potential control flow hijacking occurs. In
particular, the Forward-Edge CFI protects indirect function calls by
ensuring the prototype of function that is actually called matches the
definition of the function hook.
Since Linux now supports CFI, it will be a good idea to fix mismatched
return type for implementation of hooks. Otherwise this would get
cought out by CFI and cause a panic.
Use enums from netdev_tx_t as return value instead, then change return
type to netdev_tx_t.
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220905130230.11230-1-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Asif Khan [Sun, 4 Sep 2022 19:24:00 +0000 (00:54 +0530)]
staging: rtl8712: fix camelcase in UserPriority
Replace camelcase variable UserPriority with snake case
variable user_priority.
Signed-off-by: Asif Khan <asif.kgauri@gmail.com>
Link: https://lore.kernel.org/r/20220904192400.8309-1-asif.kgauri@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 2 Sep 2022 14:37:15 +0000 (16:37 +0200)]
staging: greybus: audio_helper: remove unused and wrong debugfs usage
In the greybus audio_helper code, the debugfs file for the dapm has the
potential to be removed and memory will be leaked. There is also the
very real potential for this code to remove ALL debugfs entries from the
system, and it seems like this is what will really happen if this code
ever runs. This all is very wrong as the greybus audio driver did not
create this debugfs file, the sound core did and controls the lifespan
of it.
So remove all of the debugfs logic from the audio_helper code as there's
no way it could be correct. If this really is needed, it can come back
with a fixup for the incorrect usage of the debugfs_lookup() call which
is what caused this to be noticed at all.
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20220902143715.320500-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 8 Sep 2022 13:09:15 +0000 (15:09 +0200)]
staging: r8188eu: remove unnecessary return labels.
Remove the RETURN labels in rtw_alloc_etherdev_with_old_priv() and
rtw_alloc_etherdev() and return directly to clean up the code and
improve readability.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908130915.8406-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 8 Sep 2022 13:09:14 +0000 (15:09 +0200)]
staging: r8188eu: make two functions static
The functions UpdateBrateTbl() and UpdateBrateTblForSoftAP() are only
used in rtw_mlme_ext.c. Make them static.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908130915.8406-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 8 Sep 2022 13:09:13 +0000 (15:09 +0200)]
staging: r8188eu: remove unused parameter from UpdateBrateTbl()
The parameter 'Adapter' of UpdateBrateTbl() is unused. Remove it.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908130915.8406-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 8 Sep 2022 13:09:12 +0000 (15:09 +0200)]
staging: r8188eu: remove unused parameters from _BeaconFunctionEnable()
The parameters 'Enable' and 'Linked' of _BeaconFunctionEnable() are
unused. Remove them.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908130915.8406-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 8 Sep 2022 07:28:15 +0000 (09:28 +0200)]
staging: r8188eu: remove some unused enums
Remove some unused enums to clean up the driver code.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908072815.31002-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:46 +0000 (22:01 +0200)]
staging: r8188eu: do not "scan blink" if we have a link
Do not blink the led to indicate that we're scanning if we are already
connected to a wireless network.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:45 +0000 (22:01 +0200)]
staging: r8188eu: reset blink state when WPS fails
When WPS fails, WPS blinking is no longer in progress. The if statement
can be removed.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:44 +0000 (22:01 +0200)]
staging: r8188eu: always cancel blink_work when WPS failed
Cancel blink_work if WPS fails. Another worker will be scheduled after
the state variables are updated.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:43 +0000 (22:01 +0200)]
staging: r8188eu: always update status before WPS blinking
Always update the status variables in rtw_led_control when we start WPS
blinking. The code is easier to understand without the if conditions.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:42 +0000 (22:01 +0200)]
staging: r8188eu: always cancel blink_work before WPS blinking
In rtw_led_control, we can always cancel a running blink worker when we
start WPS blinking.
The worker will be scheduled again and there's no point in having more
than one pending blink worker.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:41 +0000 (22:01 +0200)]
staging: r8188eu: don't restart WPS blinking unnecessarily
Simplify one of the cases in rtw_led_control. If we're already blinking
during WPS, we don't have to restart this blinking when the caller
requests it again. We can simply return and keep on blinking.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 20:01:40 +0000 (22:01 +0200)]
staging: r8188eu: simplify the LED_CTL_POWER_OFF case
When a caller of rtw_led_control requests that the led be switched off,
we should cancel the blink worker and set all blinking state variables
to false. This does not depend on the current blinking state.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 5 Sep 2022 19:56:12 +0000 (21:56 +0200)]
staging: r8188eu: remove channel parameters from rtw_sitesurvey_cmd
The rtw_sitesurvey_cmd function may receive an array of channels in the
ch and ch_num parameters. All of the callers set ch = NULL and ch_num = 0.
Remove the two parameters from rtw_sitesurvey_cmd and the code to process
them.
Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905195612.81945-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 1 Sep 2022 17:21:20 +0000 (19:21 +0200)]
staging: r8188eu: remove mlme_osdep.h
The function indicate_wx_scan_complete_event() is declared multiple
times. That is not needed. Remove redundant declarations to clean up
the driver code and remove the now empty header mlme_osdep.h.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220901172120.8485-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:52:00 +0000 (11:52 +0200)]
staging: rtl8723bs: remove rtw_is_wps_ie
Remove function rtw_is_wps_ie because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/69f128559008c94e29eab511a92964810688288e.1662111799.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:59 +0000 (11:51 +0200)]
staging: rtl8723bs: remove IsHexDigit
Remove function IsHexDigit because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/8c70ecd9bea1dff2cb8f69e12bbef6aa4ee39977.1662111799.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:58 +0000 (11:51 +0200)]
staging: rtl8723bs: remove rtw_hal_is_disable_sw_channel_plan
Remove function rtw_hal_is_disable_sw_channel_plan because it is not
used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/4398fec06b0f8defaa7da9d6abbc155cbb7ae630.1662111799.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:57 +0000 (11:51 +0200)]
staging: rtl8723bs: remove hal_btcoex_SetManualControl
Remove function hal_btcoex_SetManualControl because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/ae83ad941013d7a6c47d06f70c0f43087fe2c84f.1662111799.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:56 +0000 (11:51 +0200)]
staging: rtl8723bs: remove GetHexValueFromString
Remove function GetHexValueFromString because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/74c77a5d86570065a5fe96446063595b649f76b0.1662111798.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:55 +0000 (11:51 +0200)]
staging: rtl8723bs: remove odm_PauseDIG
Remove function odm_PauseDIG because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/274e8338398d915327d353f713b2d47e48f92ba9.1662111798.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:54 +0000 (11:51 +0200)]
staging: rtl8723bs: delete rtw_odm.c and rtw_odm.h
Remove rtw_odm.c and rtw_odm.h because the content of these files
is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/6870109ce0c51b4ab91ec370d8b2285dc635e5fe.1662111798.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nam Cao [Fri, 2 Sep 2022 09:51:53 +0000 (11:51 +0200)]
staging: rtl8723bs: remove rtw_change_ifname
Delete function rtw_change_ifname because it is not used.
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/975cd771e5b6573b84b31690895d140cbdaeb5e2.1662111798.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>