]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: libertas: fix memory leak in helper_firmware_cb()
authorDawei Feng <dawei.feng@seu.edu.cn>
Wed, 24 Jun 2026 08:53:43 +0000 (16:53 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Jul 2026 12:11:07 +0000 (14:11 +0200)
commit63c2391deefb31e1b801b7f32bd502ca4808639b
treec7a15496ab8a17eb51b5b75c1a6ef41e33bbf541
parentaa6dcd5c8dd9ba1d7d0f60093bcda41c0d6d438d
wifi: libertas: fix memory leak in helper_firmware_cb()

helper_firmware_cb() neglects to free the single-stage firmware image
after a successful async load, leading to a memory leak in the USB
firmware-download path.

Fix this memory leak by calling release_firmware() immediately after
lbs_fw_loaded() returns.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still present in
the current wireless tree.

An x86_64 allyesconfig build showed no new warnings. As we do not have
compatible Libertas USB hardware for exercising this firmware-download
path, no runtime testing was able to be performed.

Fixes: 1dfba3060fe7 ("libertas: move firmware lifetime handling to firmware.c")
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
Link: https://patch.msgid.link/20260624085343.575508-1-dawei.feng@seu.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/marvell/libertas/firmware.c