public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: rtl8723bs: Fix error handling and memory
@ 2025-12-18  1:14 Samasth Norway Ananda
  2025-12-18  1:14 ` [PATCH 1/4] staging: rtl8723bs: fix firmware memory leak on error path Samasth Norway Ananda
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Samasth Norway Ananda @ 2025-12-18  1:14 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel

This series fixes several error handling issues and memory leaks in the
rtl8723bs staging driver, found through code review and static analysis.

The patches address the following issues:

1. Firmware memory leak: In rtl8723b_FirmwareDownload(), after
   successfully calling request_firmware(), if subsequent checks fail, 
   the firmware is not released before jumping to the error path.

2. Buffer memory leak: In rtw_cfg80211_inform_bss(), when
   cfg80211_inform_bss_frame() fails, the allocated buffer is not freed.

3. Missing IS_ERR check: kthread_run() returns an ERR_PTR on failure,
   not NULL. The code in rtl8723b_start_thread() was not checking for
   this, which could cause issues when rtl8723b_stop_thread() later
   checks if the thread pointer is non-NULL.

4. Ignored return value: rtw_wdev_alloc() can fail, but its return
   value was being ignored in rtw_sdio_if1_init(), potentially leaving 
   the adapter in an inconsistent state.


Samasth Norway Ananda (4):
  staging: rtl8723bs: fix firmware memory leak on error path
  staging: rtl8723bs: fix memory leak in rtw_cfg80211_inform_bss()
  staging: rtl8723bs: add IS_ERR() check for kthread_run()
  staging: rtl8723bs: check return value of rtw_wdev_alloc()

 drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 12 ++++++++++--
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  4 +++-
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c      |  3 ++-
 3 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-12-18 17:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  1:14 [PATCH 0/4] staging: rtl8723bs: Fix error handling and memory Samasth Norway Ananda
2025-12-18  1:14 ` [PATCH 1/4] staging: rtl8723bs: fix firmware memory leak on error path Samasth Norway Ananda
2025-12-18  7:14   ` Dan Carpenter
2025-12-18 17:00     ` [External] : " samasth.norway.ananda
2025-12-18  1:14 ` [PATCH 2/4] staging: rtl8723bs: fix memory leak in rtw_cfg80211_inform_bss() Samasth Norway Ananda
2025-12-18  1:14 ` [PATCH 3/4] staging: rtl8723bs: add IS_ERR() check for kthread_run() Samasth Norway Ananda
2025-12-18  1:14 ` [PATCH 4/4] staging: rtl8723bs: check return value of rtw_wdev_alloc() Samasth Norway Ananda
2025-12-18  7:12   ` Dan Carpenter
2025-12-18 16:31     ` [External] : " samasth.norway.ananda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox