Commit Graph

2114 Commits

Author SHA1 Message Date
Luka Gejak
a75281626f staging: rtl8723bs: fix potential out-of-bounds read in rtw_restruct_wmm_ie
The current code checks 'i + 5 < in_len' at the end of the if statement.
However, it accesses 'in_ie[i + 5]' before that check, which can lead
to an out-of-bounds read. Move the length check to the beginning of the
conditional to ensure the index is within bounds before accessing the
array.

Fixes: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260224132647.11642-2-luka.gejak@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-24 10:01:20 -08:00
Greg Kroah-Hartman
f0109b9d3e staging: rtl8723bs: properly validate the data in rtw_get_ie_ex()
Just like in commit 154828bf95 ("staging: rtl8723bs: fix out-of-bounds
read in rtw_get_ie() parser"), we don't trust the data in the frame so
we should check the length better before acting on it

Cc: stable <stable@kernel.org>
Assisted-by: gkh_clanker_2000
Tested-by: Navaneeth K <knavaneeth786@gmail.com>
Reviewed-by: Navaneeth K <knavaneeth786@gmail.com>
Link: https://patch.msgid.link/2026022336-arrange-footwork-6e54@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-23 16:34:44 +01:00
Linus Torvalds
323bbfcf1e Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Linus Torvalds
bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Linus Torvalds
a5f22b9b13 Merge tag 'staging-7.0-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 updates for 7.0-rc1. Well, not
  that big, just lots of tiny coding style cleanups primarily in one
  driver as everyone seems to have glomed onto it for some reason that
  escapes me (is there a tutorial out there somewhere pointing people at
  this?)

  Not much overall, the changes can be summarized as:

   - cleanups for the rtl8723bs driver, so many cleanups...

   - vme_user driver cleanups

   - sm750fb driver cleanups

   - tiny greybus driver cleanups

   - other really small staging driver cleanups

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

* tag 'staging-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (119 commits)
  staging: rtl8723bs: refactor ODM_SetIQCbyRFpath to reduce duplication
  staging: rtl8723bs: rename CamelCase function Set_MSR to set_msr
  staging: rtl8723bs: remove unnecessary blank lines in rtw_io.c
  staging: rtl8723bs: remove stale TODO item regarding %pM
  staging: rtl8723bs: remove unused allocation wrapper functions
  staging: rtl8723bs: use standard skb allocation APIs
  staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()
  staging: rtl8723bs: replace rtw_malloc() with kmalloc()
  staging: rtl8723bs: introduce kmemdup() where applicable
  staging: sm750fb: Clean up variable names
  staging: rtl8723bs: fix null dereference in find_network
  staging: rtl8723bs: use unaligned access macros in rtw_security.c
  staging: rtl8723bs: fix potential race in expire_timeout_chk
  staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c
  staging: rtl8723bs: modernize hex output in rtw_report_sec_ie
  staging: rtl8723bs: fix spacing around operators
  staging: rtl8723bs: rename u1bTmp to val
  staging: rtl8723bs: remove unused private debug counters
  staging: rtl8723bs: remove thread wraper functions and add IS_ERR() check
  staging: rtl8723bs: fix firmware memory leak on error
  ...
2026-02-17 09:20:58 -08:00
Linus Torvalds
136114e0ab Merge tag 'mm-nonmm-stable-2026-02-12-10-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-MM updates from Andrew Morton:

 - "ocfs2: give ocfs2 the ability to reclaim suballocator free bg" saves
   disk space by teaching ocfs2 to reclaim suballocator block group
   space (Heming Zhao)

 - "Add ARRAY_END(), and use it to fix off-by-one bugs" adds the
   ARRAY_END() macro and uses it in various places (Alejandro Colomar)

 - "vmcoreinfo: support VMCOREINFO_BYTES larger than PAGE_SIZE" makes
   the vmcore code future-safe, if VMCOREINFO_BYTES ever exceeds the
   page size (Pnina Feder)

 - "kallsyms: Prevent invalid access when showing module buildid" cleans
   up kallsyms code related to module buildid and fixes an invalid
   access crash when printing backtraces (Petr Mladek)

 - "Address page fault in ima_restore_measurement_list()" fixes a
   kexec-related crash that can occur when booting the second-stage
   kernel on x86 (Harshit Mogalapalli)

 - "kho: ABI headers and Documentation updates" updates the kexec
   handover ABI documentation (Mike Rapoport)

 - "Align atomic storage" adds the __aligned attribute to atomic_t and
   atomic64_t definitions to get natural alignment of both types on
   csky, m68k, microblaze, nios2, openrisc and sh (Finn Thain)

 - "kho: clean up page initialization logic" simplifies the page
   initialization logic in kho_restore_page() (Pratyush Yadav)

 - "Unload linux/kernel.h" moves several things out of kernel.h and into
   more appropriate places (Yury Norov)

 - "don't abuse task_struct.group_leader" removes the usage of
   ->group_leader when it is "obviously unnecessary" (Oleg Nesterov)

 - "list private v2 & luo flb" adds some infrastructure improvements to
   the live update orchestrator (Pasha Tatashin)

* tag 'mm-nonmm-stable-2026-02-12-10-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (107 commits)
  watchdog/hardlockup: simplify perf event probe and remove per-cpu dependency
  procfs: fix missing RCU protection when reading real_parent in do_task_stat()
  watchdog/softlockup: fix sample ring index wrap in need_counting_irqs()
  kcsan, compiler_types: avoid duplicate type issues in BPF Type Format
  kho: fix doc for kho_restore_pages()
  tests/liveupdate: add in-kernel liveupdate test
  liveupdate: luo_flb: introduce File-Lifecycle-Bound global state
  liveupdate: luo_file: Use private list
  list: add kunit test for private list primitives
  list: add primitives for private list manipulations
  delayacct: fix uapi timespec64 definition
  panic: add panic_force_cpu= parameter to redirect panic to a specific CPU
  netclassid: use thread_group_leader(p) in update_classid_task()
  RDMA/umem: don't abuse current->group_leader
  drm/pan*: don't abuse current->group_leader
  drm/amd: kill the outdated "Only the pthreads threading model is supported" checks
  drm/amdgpu: don't abuse current->group_leader
  android/binder: use same_thread_group(proc->tsk, current) in binder_mmap()
  android/binder: don't abuse current->group_leader
  kho: skip memoryless NUMA nodes when reserving scratch areas
  ...
2026-02-12 12:13:01 -08:00
Bera Yüzlü
319e3ff5ed staging: rtl8723bs: refactor ODM_SetIQCbyRFpath to reduce duplication
Refactor ODM_SetIQCbyRFpath to remove duplicated PHY_SetBBReg()
calls and improve readability.

The original implementation duplicated the same PHY_SetBBReg()
calls for both RF paths (S0 / S1) with only the path index
changing. This reduces code duplication,
makes the intent clearer and eases future maintenance.

No functional change intended: register keys/values and
the selection logic remain the same.

Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
Link: https://patch.msgid.link/aYdF3QYfFHYk3Lpe@BERA.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 15:11:01 +01:00
Tan Kai Zhe
11c6c251fa staging: rtl8723bs: rename CamelCase function Set_MSR to set_msr
Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: Avoid CamelCase: <Set_MSR>

Signed-off-by: Tan Kai Zhe <kaizhetan@yahoo.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260207061313.20103-1-kaizhetan@yahoo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:45:39 +01:00
Tan Kai Zhe
bad0520ee2 staging: rtl8723bs: remove unnecessary blank lines in rtw_io.c
Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Tan Kai Zhe <kaizhetan@yahoo.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260206001833.16857-1-kaizhetan@yahoo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:44:26 +01:00
Haroen Tmimi
a20463de51 staging: rtl8723bs: remove stale TODO item regarding %pM
The TODO list asks to "find codes that can use %pM and %Nph formatting".

A grep of the driver directory shows that no manual MAC address formatting
(using "%02x:%02x:..) remains in the code, thus all instances appear to have
been converted to use "%pM".

Remove the stale entry from the TODO list.

Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
Link: https://patch.msgid.link/20260205145159.185981-1-tmimiharoen@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:44:24 +01:00
Minu Jin
0dced5c061 staging: rtl8723bs: remove unused allocation wrapper functions
Remove the custom memory allocation wrapper functions and macros from
osdep_service.c and osdep_service.h as they are no longer used.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260204131347.3515949-6-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:35:33 +01:00
Minu Jin
9fe6f146a3 staging: rtl8723bs: use standard skb allocation APIs
Replace custom wrappers rtw_skb_alloc() and rtw_skb_copy() with
standard kernel APIs __dev_alloc_skb() and skb_copy().

About GFP Flags:
- GFP_ATOMIC is used for allocations in atomic contexts such as
  spinlock-protected sections, tasklets, and timer handlers.
- GFP_KERNEL is used for process contexts where sleeping is allowed.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260204131347.3515949-5-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:35:32 +01:00
Minu Jin
980cd426a2 staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()
Replace the wrapper function rtw_zmalloc() with standard kzalloc().
Use kzalloc() for rtw_malloc() calls that were followed by manual
zero initialization.

About GFP Flags:
- GFP_ATOMIC is used for allocations in atomic contexts such as
  spinlock-protected sections, tasklets, and timer handlers.
- GFP_KERNEL is used for process contexts where sleeping is allowed.

Additionally, use array_size() and size_add() to prevent potential
integer overflows during allocation size calculation.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260204131347.3515949-4-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:35:31 +01:00
Minu Jin
9577f3b333 staging: rtl8723bs: replace rtw_malloc() with kmalloc()
Replace the wrapper function rtw_malloc() with standard kmalloc().
Call sites were reviewed to use appropriate GFP flags (GFP_KERNEL or
GFP_ATOMIC) based on the execution context.

About GFP Flags:
- GFP_ATOMIC is used for allocations in atomic contexts such as
  spinlock-protected sections, tasklets, and timer handlers.
- GFP_KERNEL is used for process contexts where sleeping is allowed.

Also, convert error return codes from -1 to -ENOMEM where appropriate.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260204131347.3515949-3-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:35:28 +01:00
Minu Jin
5ed9ef2703 staging: rtl8723bs: introduce kmemdup() where applicable
Replace memory allocation followed by memcpy() with kmemdup() to simplify
the code and improve readability.

About GFP Flags:
- GFP_ATOMIC is used for allocations in atomic contexts such as
  spinlock-protected sections, tasklets, and timer handlers.
- GFP_KERNEL is used for process contexts where sleeping is allowed.

Specifically, in OnAssocReq(), GFP_ATOMIC is used because
the allocation is performed while holding a spin lock.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260204131347.3515949-2-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:35:26 +01:00
Ethan Tidmore
41460a1965 staging: rtl8723bs: fix null dereference in find_network
The variable pwlan has the possibility of being NULL when passed into
rtw_free_network_nolock() which would later dereference the variable.

Fixes: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260202205429.20181-1-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:22:04 +01:00
Archit Anant
17d2ff4041 staging: rtl8723bs: use unaligned access macros in rtw_security.c
The driver defines custom functions secmicgetuint32() and
secmicputuint32() to handle little-endian byte-to-integer conversion.
This is redundant as the kernel provides optimized standard macros for
this purpose in <linux/unaligned.h>.

Replace the custom implementations with get_unaligned_le32() and
put_unaligned_le32() and delete the now-unused local functions.

Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260130075113.34666-1-architanant5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:20:51 +01:00
Minu Jin
02df7c635b staging: rtl8723bs: fix potential race in expire_timeout_chk
The expire_timeout_chk function currently do lock and unlock inside the
loop before calling rtw_free_stainfo().

This can be risky as the list might be changed
when the lock is briefly released.

To fix this, move expired sta_info entries into a local free_list while
holding the lock, and then perform the actual freeing after the lock is
released.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260131171153.3729458-1-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:10:04 +01:00
Luka Gejak
8ae0398e70 staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c
Remove the unused local variable 'pattrib' and the unreachable 'if (0)'
debug block in OnAction_sa_query to clean up the driver code.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260130185658.207785-6-lukagejak5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:08:38 +01:00
Luka Gejak
3db1248206 staging: rtl8723bs: modernize hex output in rtw_report_sec_ie
Replace the manual hex-printing loop with the standard kernel '%*ph'
format string. This simplifies the code and uses modern logging
practices.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260130185658.207785-5-lukagejak5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:08:38 +01:00
Luka Gejak
908c03bf95 staging: rtl8723bs: fix spacing around operators
Fix coding style issues by adding missing spaces around operators.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260130185658.207785-4-lukagejak5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:08:38 +01:00
Luka Gejak
01e28097a0 staging: rtl8723bs: rename u1bTmp to val
Rename the variable u1bTmp to val to remove Hungarian notation. This
improves readability and aligns the code with kernel naming standards.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260130185658.207785-3-lukagejak5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 14:08:38 +01:00
Ethan Tidmore
7de30d5d76 staging: rtl8723bs: remove unused private debug counters
The driver maintains a private `struct debug_priv` embedded within
`struct dvobj_priv` to track various error counters (e.g., suspend
errors, alloc failures, RX drops).

These counters are incremented in various files but the data is
never read or exposed to userspace.

Remove the unused `debug_priv` structure definition, the instance
in `dvobj_priv`, and all associated increment operations across
the driver to clean up the code.

This also removes the following helper functions which were used
solely to update these counters:
 - rtw_reset_rx_info()
 - recv_indicatepkts_pkt_loss_cnt()

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260131212128.25548-1-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:43:27 +01:00
Samasth Norway Ananda
c41ac35307 staging: rtl8723bs: remove thread wraper functions and add IS_ERR() check
The rtl8723b_start_thread() and rtl8723b_stop_thread() functions are
wrappers that are only called from one place each. Remove these wrapper
functions and inline the thread handling directly in
rtw_start_drv_threads() and rtw_stop_drv_threads().

This also fixes a bug where kthread_run() was not checked for errors
using IS_ERR(). kthread_run() returns ERR_PTR(-ENOMEM) on failure, not
NULL. Without this check, the SdioXmitThread pointer could contain an
error value, causing issues when rtw_stop_drv_threads() later attempts
to use it.

The inlined code now follows the same pattern as xmitThread and
cmdThread in rtw_start_drv_threads(), with proper IS_ERR() checking.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Link: https://patch.msgid.link/20260130001641.17941-4-samasth.norway.ananda@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:35:58 +01:00
Samasth Norway Ananda
4dba9d6c69 staging: rtl8723bs: fix firmware memory leak on error
After successfully calling request_firmware(), if the firmware size
check fails or if kmemdup() fails, the code jumps to the exit label
without calling release_firmware(), causing a memory leak. Call
release_firmware() directly in each error path before jumping to cleanup
label.

Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260130001641.17941-2-samasth.norway.ananda@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:35:48 +01:00
Siwanan Bungtong
a6fe09b40b staging: rtl8723bs: remove unnecessary parentheses
Remove redundant parentheses around 'address of' expressions
to comply with kernel coding style.

Signed-off-by: Siwanan Bungtong <horstaufmental@gmail.com>
Link: https://patch.msgid.link/20260129221719.943285-1-horstaufmental@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:35:40 +01:00
Colin Ian King
c42727601a staging: rtl8723bs: remove redundant check on status
The check on status can be removed because all previous
assignments on status are followed by a goto statement that
bypasses the status check. This minor issue was detected with
Coverity Scan static analysis. Remove the redundant check and
some empty lines.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20260129161058.197372-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:34 +01:00
Mahad Ibrahim
500cf758c8 staging: rtl8723bs: standardize comment style in HAL
The kernel coding style for comments requires a single space after the
"/*". Currently, many files in HAL contain two spaces after the "/*", or
use irregular indentation. The modified files also suffer from this.

Fix line comment style inconsistencies by removing additional space after
"/*" to adhere to kernel coding standards.

Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com>
Link: https://patch.msgid.link/20260129160426.13737-6-mahad.ibrahim.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:18 +01:00
Mahad Ibrahim
d4f0c3edcc staging: rtl8723bs: fix line length check
Fix checkpatch.pl check regarding:
- Line length of X exceeds 100 columns

Redistribute comments to multiple lines to adhere to kernel coding
standards.

Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com>
Link: https://patch.msgid.link/20260129160426.13737-5-mahad.ibrahim.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:18 +01:00
Mahad Ibrahim
ce154efc04 staging: rtl8723bs: fix missing blank line after declaration
Fix checkpatch.pl warning regarding:
- Missing a blank line after declarations

Adhere to kernel coding standards by adding a blank line after variable
declaration.

Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com>
Link: https://patch.msgid.link/20260129160426.13737-4-mahad.ibrahim.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:18 +01:00
Mahad Ibrahim
d868ba3032 staging: rtl8723bs: fix multiple blank line check
Fix checkpatch.pl check regarding:
- Please don't use multiple blank lines

Remove multiple blank lines to adhere to kernel coding standards.

Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com>
Link: https://patch.msgid.link/20260129160426.13737-3-mahad.ibrahim.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:18 +01:00
Mahad Ibrahim
2a9fa972e3 staging: rtl8723bs: fix open parenthesis alignment
Fix checkpatch.pl check regarding:
- Lines should not end with a '('

Collapse the multi-line function signature of CheckPositive() into a
single line to adhere to kernel coding standards.

Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com>
Link: https://patch.msgid.link/20260129160426.13737-2-mahad.ibrahim.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:30:17 +01:00
Tanjim Kamal
ad3521dc9c staging: rtl8723bs: constify _action_public_str array
This array is never modified. Add a second const to make the array
itself be placed in read-only .rodata instead of just the strings it
points to.

Fix a WARNING issued by scripts/checkpatch.pl.

Signed-off-by: Tanjim Kamal <tanjimkamal1@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260128113900.44852-1-tanjimkamal1@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:04:57 +01:00
Louis Lesniak
11f4e52502 staging: rtl8723bs: remove unnecessary braces
Remove braces from single statement if blocks to adhere to the
Linux kernel coding style.

Signed-off-by: Louis Lesniak <louis.lesniak2@gmail.com>
Link: https://patch.msgid.link/20260128154407.42421-1-louis.lesniak2@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:00:45 +01:00
Minu Jin
b59f9bc5f3 staging: rtl8723bs: clean up _rtw_pktfile_read()
Clean up the function by changing 'uint' to 'unsigned int' to comply
with the kernel coding style, as suggested by Andy Shevchenko.

Signed-off-by: Minu Jin <s9430939@naver.com>
Link: https://patch.msgid.link/20260127153811.1592900-3-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:00:35 +01:00
Minu Jin
bc4df274dc staging: rtl8723bs: update _rtw_pktfile_read() to return error codes
The function _rtw_pktfile_read() currently returns a uint and clamps
the requested read length if it exceeds the remaining data. This
behavior makes it impossible to propagate error codes from internal
calls like skb_copy_bits() and leads to incomplete data processing.

This patch updates the function to:
    1. Return -EINVAL if the remaining data is less than the requested length,
       ensuring callers always get the full amount of data they expect.

    2. Propagate the negative error code from skb_copy_bits().

    3. Change the return type from uint to int to support these error codes.

To avoid breaking git bisect, this patch also updates all call sites
(set_qos, update_attrib, and rtw_xmitframe_coalesce) in the same commit.
By doing so, the error-producing function and its error-handling callers
remain in sync, preventing runtime failures at this commit point.

Signed-off-by: Minu Jin <s9430939@naver.com>
Link: https://patch.msgid.link/20260127153811.1592900-2-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-07 13:00:35 +01:00
Ethan Tidmore
1d264b88ae staging: rtl8723bs: remove unused variable RFE_Type
The variable RFE_Type is initialized but never read or used
anywhere in the driver. Remove it to clean up dead code and fix
a CamelCase warning.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-9-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:15 +01:00
Ethan Tidmore
c003c37898 staging: rtl8723bs: remove unused variable bEn_RFE
The variable bEn_RFE is initialized but never read or used anywhere in the
driver. Remove it to clean up dead code and fix a CamelCase warning.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-8-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:15 +01:00
Ethan Tidmore
88773d6b32 staging: rtl8723bs: remove unused variable AmplifierType_2G
The variable AmplifierType_2G is declared in struct registry_priv but
is never initialized or used within the driver. Remove it to clean up
the code and fix a CamelCase warning.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-7-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:15 +01:00
Ethan Tidmore
6af021ad7b staging: rtl8723bs: remove unused variable TxBBSwing_2G
The variable TxBBSwing_2G is initialized but never read or used
anywhere in the driver. Remove it to clean up dead code and fix
a CamelCase warning.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-6-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:15 +01:00
Ethan Tidmore
7c347fbe21 staging: rtl8723bs: rename RegPwrTblSel to reg_pwr_tbl_sel
Rename RegPwrTblSel to reg_pwr_tbl_sel to avoid CamelCase.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-5-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:14 +01:00
Ethan Tidmore
43e165f7e0 staging: rtl8723bs: rename RegPowerBase to reg_power_base
Rename RegPowerBase to reg_power_base to avoid CamelCase.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-4-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:14 +01:00
Ethan Tidmore
a3f440616a staging: rtl8723bs: rename RegEnableTxPowerByRate to reg_enable_tx_power_by_rate
Rename RegEnableTxPowerByRate to reg_enable_tx_power_by_rate to
 avoid CamelCase.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-3-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:14 +01:00
Ethan Tidmore
00883ce1d4 staging: rtl8723bs: rename RegEnableTxPowerLimit to reg_enable_tx_power_limit
Rename RegEnableTxPowerLimit to reg_enable_tx_power_limit to avoid
CamelCase.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260127012118.43037-2-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:51:14 +01:00
Michael Huang
2c1312898d staging: rtl8723bs: remove unnecessary boolean comparisons
Remove explicit comparisons to true/false in boolean expressions to
improve code readability and follow standard Linux kernel coding style.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Link: https://patch.msgid.link/20260126120908.19563-1-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:47:32 +01:00
Michael Huang
6007fd4603 staging: rtl8723bs: use !ptr instead of ptr == NULL
Simplify pointer null checks by using the "!ptr" convention instead of
the more verbose "ptr == NULL" comparison.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260124231557.18189-8-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:46:34 +01:00
Michael Huang
5747a86451 staging: rtl8723bs: remove unnecessary braces
Remove braces from single-line conditional statements.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260124231557.18189-7-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:46:34 +01:00
Michael Huang
d583b26c9e staging: rtl8723bs: add missing space around operators
Add required spaces around logical and assignment operators.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260124231557.18189-6-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:46:34 +01:00
Michael Huang
376208a262 staging: rtl8723bs: Fix the line length exceeding 100 columns warning in the code
Split lines that exceed the 100-character limit into multiple lines.
This resolves checkpatch.pl warnings and improves the visual layout
of the source code.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260124231557.18189-5-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-27 15:46:34 +01:00