]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
staging: rtl8723bs: fix memory leak on failure path
authorDiksha Kumari <dikshakdevgan@gmail.com>
Tue, 13 Jan 2026 09:17:12 +0000 (14:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2026 13:09:00 +0000 (14:09 +0100)
commitabe850d82c8cb72d28700673678724e779b1826e
tree0063dd6b178a9ec8a02e39b02dd187b10c8f762a
parent6cb679d8fe309e94f46943678d8ee965e4b42c5f
staging: rtl8723bs: fix memory leak on failure path

cfg80211_inform_bss_frame() may return NULL on failure. In that case,
the allocated buffer 'buf' is not freed and the function returns early,
leading to potential memory leak.
Fix this by ensuring that 'buf' is freed on both success and failure paths.

Signed-off-by: Diksha Kumari <dikshakdevgan@gmail.com>
Reviewed-by: Mukesh Kumar Chaurasiya <mkchauras@linux.ibm.com>
Link: https://patch.msgid.link/20260113091712.7071-1-dikshakdevgan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c