Commit Graph

2017 Commits

Author SHA1 Message Date
Navaneeth K
502ddcc405 staging: rtl8723bs: fix out-of-bounds read in OnBeacon ESR IE parsing
The Extended Supported Rates (ESR) IE handling in OnBeacon accessed
*(p + 1 + ielen) and *(p + 2 + ielen) without verifying that these
offsets lie within the received frame buffer. A malformed beacon with
an ESR IE positioned at the end of the buffer could cause an
out-of-bounds read, potentially triggering a kernel panic.

Add a boundary check to ensure that the ESR IE body and the subsequent
bytes are within the limits of the frame before attempting to access
them.

This prevents OOB reads caused by malformed beacon frames.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-27 15:16:37 +01:00
Navaneeth K
6ef0e1c104 staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing
The Supported Rates IE length from an incoming Association Request frame
was used directly as the memcpy() length when copying into a fixed-size
16-byte stack buffer (supportRate). A malicious station can advertise an
IE length larger than 16 bytes, causing a stack buffer overflow.

Clamp ie_len to the buffer size before copying the Supported Rates IE,
and correct the bounds check when merging Extended Supported Rates to
prevent a second potential overflow.

This prevents kernel stack corruption triggered by malformed association
requests.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-27 15:16:34 +01:00
Navaneeth K
154828bf95 staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser
The Information Element (IE) parser rtw_get_ie() trusted the length
byte of each IE without validating that the IE body (len bytes after
the 2-byte header) fits inside the remaining frame buffer. A malformed
frame can advertise an IE length larger than the available data, causing
the parser to increment its pointer beyond the buffer end. This results
in out-of-bounds reads or, depending on the pattern, an infinite loop.

Fix by validating that (offset + 2 + len) does not exceed the limit
before accepting the IE or advancing to the next element.

This prevents OOB reads and ensures the parser terminates safely on
malformed frames.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-27 15:16:30 +01:00
Navaneeth K
ea39cd0e42 staging: rtl8723bs: remove custom FIELD_OFFSET macro
The custom FIELD_OFFSET macro is no longer used in the driver (replaced
by standard offsetof). Remove the definition.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-6-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 14:21:02 +01:00
Navaneeth K
d82c5681df staging: rtl8723bs: replace FIELD_OFFSET usage with offsetof in rtw_mlme_ext.c
Replace usage of the custom FIELD_OFFSET macro with the standard
offsetof() macro in rtw_mlme_ext.c. This improves code readability
and uses the kernel's standard mechanism.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-5-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 14:21:02 +01:00
Navaneeth K
2cbcfd3fce staging: rtl8723bs: remove dead commented code from odm.c
Remove obsolete commented-out code that references unsupported chip
variants (ODM_RTL8723A, ODM_RTL8188E). This code has been dead since
the driver was added to staging.

Also fix the resulting formatting by removing the unnecessary outer
parentheses and moving the inline comment to its own line.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-4-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 14:21:02 +01:00
Navaneeth K
6ddb173fcf staging: rtl8723bs: use standard offsetof in cfg80211 operations
Replace usage of the custom FIELD_OFFSET macro with the standard
offsetof() macro in ioctl_cfg80211.c. This improves code readability
and uses the kernel's standard mechanism.

Also include <linux/stddef.h> in basic_types.h to ensure offsetof()
is available for this and future conversions.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-3-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 14:21:02 +01:00
Navaneeth K
e09748f874 staging: rtl8723bs: remove unused registry and BSSID offset macros
The RGTRY_OFT, RGTRY_SZ, BSSID_OFT, and BSSID_SZ macros are defined but
never used anywhere in the driver. Remove these dead macro definitions
to clean up the code.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-2-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 14:21:02 +01:00
Artur Stupa
39781cc3d5 staging: rtl8723bs: core: delete commented-out code
Delete dead commented-out code.

No functional changes.

Signed-off-by: Artur Stupa <arthur.stupa@gmail.com>
Link: https://patch.msgid.link/20251121224143.33701-2-arthur.stupa@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 12:33:08 +01:00
Artur Stupa
18ac97e9de staging: rtl8723bs: core: fix block comment style issues
Fix the following checkpatch warnings for block comments:
* Block comments should align the * on each line
* Block comments use * on subsequent lines
* Block comments use a trailing */ on a separate line

No functional changes.

Signed-off-by: Artur Stupa <arthur.stupa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251121224143.33701-1-arthur.stupa@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 12:33:08 +01:00
Dharanitharan R
79b6761260 staging: rtl8723bs: use ether_addr_copy() for MAC address copying
Replaces multiple memcpy() calls with ether_addr_copy() for copying
MAC/Ethernet addresses in rtl8723bs. This improves readability and
aligns with Linux kernel best practices for handling Ethernet addresses.

Fixes the following checkpatch.pl warning:
"Use ether_addr_copy() instead of memcpy() for Ethernet addresses."

These updates enhance code clarity and maintain consistency with
network driver conventions.

Signed-off-by: Dharanitharan R <dharanitharan725@gmail.com>
Link: https://patch.msgid.link/20251023145903.2557-1-dharanitharan725@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-09 11:18:46 +09:00
Rodrigo Gobbi
de4cbbdf2d staging: rtl8723bs: remove todo/note and duplicated EFUSE_CTRL macro
The usage of EFUSE_xxx and MSR macros are already in place, so the note
and todo about that can be removed. Also, there was a duplication of the
definition of EFUSE_CTRL macro in two places, keep the one at the .h file.

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://patch.msgid.link/20251022220324.14260-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-09 11:18:23 +09:00
Bryant Boatright
b8b4b51be7 staging: rtl8723bs: Rename camel case functions.
Rename two functions from camel case to snake case to follow kernel
style.
- `UpdateBrateTbl` to `update_basic_rate_table`
- `UpdateBrateTblForSoftAP` to `update_basic_rate_table_soft_ap`

Signed-off-by: Bryant Boatright <bryant.boatright@proton.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 10:38:55 +02:00
Michael Straube
b655b838ae staging: rtl8723bs: fall back to random mac address
Use a random mac address if we cannot load it from the efuses.

Do not use a constant mac address as fallback. This may create conflicts
if we have several rtl8723bs devices on the network.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 10:38:37 +02:00
Rohan Tripathi
70d45d4b34 staging: rtl8723bs: wrap long comments in rtw_ap.c
This patch fixes instances of comment lines in rtw_ap.c that exceeded the
recommended 80–100 character limit. The affected comments were reflowed
to span multiple lines, each starting with " * " as per kernel coding
style guidelines.

These are coding style cleanups only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Link: https://lore.kernel.org/r/20251007091303.491115-6-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rohan Tripathi
9aa392c25d staging: rtl8723bs: add spaces around '+' operator in rtw_ap.c
This patch fixes instances where the '+' operator was used without
surrounding spaces. Kernel coding style requires spaces around
binary operators to improve readability.

This is a coding style cleanup only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Link: https://lore.kernel.org/r/20251007091303.491115-5-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rohan Tripathi
c318aef7f3 staging: rtl8723bs: fix lines starting with '(' in rtw_ap.c
This patch removes cases where code lines began with an opening
parenthesis or alignment issue, which is against kernel coding style. The affected
expressions have been reformatted so that continuation lines align
with the opening parenthesis of the statement.

This is a coding style cleanup only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Link: https://lore.kernel.org/r/20251007091303.491115-4-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rohan Tripathi
84aa0f7b20 staging: rtl8723bs: remove dead code in rtw_ap.c
This patch removes a commented-out assignment to
psta->dot118021XPrivacy in rtw_ap.c. The comment indicates
that the statement is no longer needed, so keeping it adds
no value.

Removing this line (and the superfluous blank line that
remained with it) improves code readability and matches
kernel coding style.

This is a cleanup only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Link: https://lore.kernel.org/r/20251007091303.491115-3-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rohan Tripathi
10f0c1ef2c staging: rtl8723bs: add missing blank line in rtw_ap.c
This patch adds a missing blank line after a function to improve readability
and follow the Linux kernel coding style guidelines.

This is a coding style cleanup only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Link: https://lore.kernel.org/r/20251007091303.491115-2-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rohan Tripathi
907772838f staging: rtl8723bs: remove unnecessary blank lines in rtw_ap.c
This patch removes superfluous blank lines where appropriate to improve readability and match kernel coding style.

This is a coding style cleanup only. No functional changes.

Signed-off-by: Rohan Tripathi <trohan2000@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20251007091303.491115-1-trohan2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rodrigo Gobbi
5cfa43ae13 staging: rtl8723bs: Remove unsupported PALTFORM_OS_WINCE ifdef
Despite the typo at PALTFORM_OS_WINCE, its a reference to OS Win CE,
which definitely is not applicable here, so clean it up any mention to it.

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://lore.kernel.org/r/20251006122524.9442-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Rodrigo Gobbi
b3c253cda6 staging: rtl8723bs: Remove commented ifdef CONFIG_WAPI_SUPPORT
Remove ifdef CONFIG_WAPI_SUPPORT comment from rtw_ieee80211 since there
is no way to enable or use it. Also, there is no documentation about the
purpose of that config.

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://lore.kernel.org/r/20251006121825.8114-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:28 +02:00
Sameeksha Sankpal
7550f96a57 staging: rtl8723bs: Fix operator spacing in rtw_security.c
This file has multiple style issues where spaces were missing around
operators. Cleaned up the entire file by adding the required spacing
around the arithmetic, logical, and comparison operators to improve
readibility and adhere to the Linux kernel coding style guidelines.

Signed-off-by: Sameeksha Sankpal <sameekshasankpal@gmail.com>
Link: https://lore.kernel.org/r/20251006042005.9778-1-sameekshasankpal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:27 +02:00
Michael Straube
5489773c3c staging: rtl8723bs: rtw_hal_set_def_var is not used
The function rtw_hal_set_def_var is not used. Remove the function and
resulting dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20250927182700.184174-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:27 +02:00
Akiyoshi Kurita
561f0ed96a staging: rtl8723bs: sdio: clarify OQT free page comment
Clarify the comment above HalQueryTxBufferStatus8723BSdio() to use
"TX OQT free page count" wording consistent with SDIO_REG_OQT_FREE_PG.

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Link: https://lore.kernel.org/r/20250917124221.1466298-1-weibu@redadmin.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:27 +02:00
Josephine Pfeiffer
d51ffb3b41 staging: rtl8723bs: Add missing MODULE_DESCRIPTION()
Add missing MODULE_DESCRIPTION() macro to the RTL8723BS SDIO
interface driver to fix the modpost warning.

Fixes modpost warning:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/staging/rtl8723bs/r8723bs.o

Signed-off-by: Josephine Pfeiffer <hi@josie.lol>
Link: https://lore.kernel.org/r/20250922154344.641438-1-hi@josie.lol
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13 09:09:27 +02:00
Linus Torvalds
59697e061f Merge tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
 "Here is the 'big' set of staging driver changes for 6.18-rc1. Nothing
  really exciting in here they pretty much consist of:

   - minor coding style changes and cleanups

   - some api layer removals where not needed

  Overall a quiet development cycle.

  All have been in linux-next for a while with no reported issues"

* tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (63 commits)
  staging: rtl8723bs: xmit: rephrase comment and drop extra space
  staging: sm750fb: rename camel case variable
  staging: rtl8723bs: hal: put return type and function name on one line
  staging: rtl8723bs: fix typo in comment
  staging: sm750fb: rename snake case variables
  staging: sm750fb: remove unnecessary volatile qualifiers
  staging: rtl8723bs: rtw_efuse.h: simplify copyright banner
  staging: rtl8723bs: remove unused tables
  staging: rtl8723bs: Hal_EfuseParseAntennaDiversity_8723B is empty
  staging: rtl8723bs: remove REG_EFUSE_ACCESS_8723 and EFUSE_ACCESS_ON_8723
  staging: rtl8723bs: remove bWrite from Hal_EfusePowerSwitch
  staging: rtl8723bs: remove wrapper Efuse_PowerSwitch
  staging: octeon: Clean up dead code in ethernet-tx.c
  staging: rtl8723bs: fix fortify warnings by using struct_group
  staging: gpib: use int type to store negative error codes
  staging: rtl8723bs: remove include/recv_osdep.h
  staging: rtl8723bs: remove os_dep/recv_linux.c
  staging: rtl8723bs: rename rtw_os_recv_indicate_pkt
  staging: rtl8723bs: move rtw_os_recv_indicate_pkt to rtw_recv.c
  staging: rtl8723bs: rename rtw_os_alloc_msdu_pkt
  ...
2025-10-04 16:17:14 -07:00
Akiyoshi Kurita
b76029bdd7 staging: rtl8723bs: xmit: rephrase comment and drop extra space
Rephrase the comment to avoid the "number of" construction and remove
an extra leading space.

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Link: https://lore.kernel.org/r/20250917063729.1450525-1-weibu@redadmin.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-17 12:15:33 +02:00
Akiyoshi Kurita
357704a3cf staging: rtl8723bs: hal: put return type and function name on one line
Make the function definition of phy_StoreTxPowerByRateBase() follow the
kernel coding style by placing the return type and function name on a
single line.

No functional change.

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Link: https://lore.kernel.org/r/20250912162613.776769-1-weibu@redadmin.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-14 17:08:38 +02:00
Akiyoshi Kurita
0daed4c3b6 staging: rtl8723bs: fix typo in comment
Fix a misspelling in a header comment: "configurtions" -> "configurations".

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20250912064406.707039-1-weibu@redadmin.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-12 15:54:19 +02:00
Akiyoshi Kurita
6f19c1ef7f staging: rtl8723bs: rtw_efuse.h: simplify copyright banner
Replace the banner-style copyright comment with a single-line comment.
No functional changes.

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Link: https://lore.kernel.org/r/20250909053327.140763-1-weibu@redadmin.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-12 15:53:16 +02:00
Michael Straube
013c09b7ac staging: rtl8723bs: remove unused tables
Remove some unused tabels to get rid of dead code and thereby reduce the
object file size by more than 1400 bytes.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20250908061243.62692-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-12 15:51:55 +02:00
Michael Straube
7cce3d7bce staging: rtl8723bs: Hal_EfuseParseAntennaDiversity_8723B is empty
The function Hal_EfuseParseAntennaDiversity_8723B is empty, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Trendbook Next 14
Link: https://lore.kernel.org/r/20250824095830.79233-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:48 +02:00
Michael Straube
5cea88cab6 staging: rtl8723bs: remove REG_EFUSE_ACCESS_8723 and EFUSE_ACCESS_ON_8723
The macros REG_EFUSE_ACCESS_8723 and EFUSE_ACCESS_ON_8723 are redundant,
both are already defined in header files without the _8723 suffix. Remove
them and use the marcos from the header files.

rtl8723b_hal.h:138:
 #define EFUSE_ACCESS_ON  0x69 /* For RTL8723 only. */

hal_com_reg.h:35:
 #define REG_EFUSE_ACCESS 0x00CF /*  Efuse access protection for RTL8723 */

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Trendbook Next 14
Link: https://lore.kernel.org/r/20250824095830.79233-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:48 +02:00
Michael Straube
236faa3b92 staging: rtl8723bs: remove bWrite from Hal_EfusePowerSwitch
The function Hal_EfusePowerSwitch is always called with bWrite set to
false. Remove the pWrite parameter and reomve resulting dead code to reduce
code complexity.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Trendbook Next 14
Link: https://lore.kernel.org/r/20250824095830.79233-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:48 +02:00
Michael Straube
009798ff04 staging: rtl8723bs: remove wrapper Efuse_PowerSwitch
The function Efuse_PowerSwitch is just a wrapper around
Hal_EfusePowerSwitch. Remove the wrapper and use Hal_EfusePowerSwitch
directly.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Trendbook Next 14
Link: https://lore.kernel.org/r/20250824095830.79233-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:48 +02:00
yingche
0bbf8fb9e3 staging: rtl8723bs: fix fortify warnings by using struct_group
Fix fortify_memcpy_chk warnings in rtw_BIP_verify() and
rtw_mgmt_xmitframe_coalesce() functions by using struct_group
to access consecutive address fields.

Changed memcpy calls to use &hdr->addrs instead of hdr->addr1
when copying 18 bytes (addr1 + addr2 + addr3).

This resolves 'detected read beyond size of field' warnings
by using the proper struct_group mechanism as suggested by
the compiler.

Signed-off-by: yingche <zxcv2569763104@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20250829040906.895221-1-zxcv2569763104@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:38 +02:00
Michael Straube
533656d39f staging: rtl8723bs: remove include/recv_osdep.h
Move still needed function prototypes defined in the recv_osdep.h header
to rtw_recv.h and remove the now obsolete recv_osdep.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:13 +02:00
Michael Straube
6009d6fd82 staging: rtl8723bs: remove os_dep/recv_linux.c
After previous patches the file os_dep/recv_linux.c is empty now and we
can remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:13 +02:00
Michael Straube
1d7e13c8b7 staging: rtl8723bs: rename rtw_os_recv_indicate_pkt
Rename rtw_os_recv_indicate_pkt to rtw_recv_indicate_pkt as the _os_
indicates operating system dependent code which is unnecessary for
in-tree linux kernel code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
cc18433094 staging: rtl8723bs: move rtw_os_recv_indicate_pkt to rtw_recv.c
Move the function rtw_os_recv_indicate_pkt from os_dep/recv_linux.c to
core/rtw_recv.c to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
b870844cd0 staging: rtl8723bs: rename rtw_os_alloc_msdu_pkt
Rename rtw_os_alloc_msdu_pkt to rtw_alloc_msdu_pkt as the _os_
indicates operating system dependent code which is unnecessary
for in-tree linux kernel code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
f44d85d5a2 staging: rtl8723bs: move rtw_os_alloc_msdu_pkt to rtw_recv.c
Move the function rtw_os_alloc_msdu_pkt from os_dep/recv_linux.c to
core/rtw_recv.c to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
10bcaf9ccc staging: rtl8723bs: merge rtw_os_recvbuf_resource_free into rtl8723bs_recv.c
Merge rtw_os_recvbuf_resource_free into rtl8723bs_init_recv_priv and into
rtl8723bs_free_recv_priv to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
0ae5ca4fb6 staging: rtl8723bs: merge rtw_os_recv_resource_free into rtw_recv.c
Merge the functionality of rtw_os_recv_resource_free in os_dep/recv_linux.c
into _rtw_free_recv_priv in core/rtw_recv.c to reduce code in the os_dep
directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
aec747851b staging: rtl8723bs: merge rtw_os_recv_resource_alloc into rtw_recv.c
Merge the functionality of rtw_os_recv_resource_alloc into
_rtw_init_recv_priv to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
d91ccaaf09 staging: rtl8723bs: merge rtw_os_free_recvframe into rtw_recv.c
Merge the functionality of rtw_os_free_recvframe in os_dep/recv_linux.c
into rtw_free_recvframe in core/rtw_recv.c to reduce code in the os_dep
directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
9766096c1e staging: rtl8723bs: move rtw_handle_tkip_mic_err to rtw_recv.c
Move the function rtw_handle_tkip_mic_err from os_dep/recv_linux.c to
core/rtw_recv.c to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
f97151eb17 staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c
Move the function rtw_recv_indicatepkt from os_dep/recv_linux.c to
core/rtw_recv.c to reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:12 +02:00
Michael Straube
0149f27d1a staging: rtl8723bs: remove wrapper rtw_init_recv_timer
The function rtw_init_recv_timer in os_dep/recv_linux.c is jsut a wrapper
around timer_setup. Use timer_setup directly and remove the wrapper to
reduce code in the os_dep directory.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-06 15:55:11 +02:00