]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: ath11k: fix memory leaks in beacon template setup
authorZilin Guan <zilin@seu.edu.cn>
Fri, 30 Jan 2026 08:44:51 +0000 (08:44 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 26 Feb 2026 21:25:39 +0000 (13:25 -0800)
commitff49eba595df500e4ddccc593088c8a4ab5f2c27
tree88e46ca9769a5db0bc72ed092df35e3c0b5a8ecd
parent151322bccdbdb132f5a73cc8ad5d3ab89b90ed52
wifi: ath11k: fix memory leaks in beacon template setup

The functions ath11k_mac_setup_bcn_tmpl_ema() and
ath11k_mac_setup_bcn_tmpl_mbssid() allocate memory for beacon templates
but fail to free it when parameter setup returns an error.

Since beacon templates must be released during normal execution, they
must also be released in the error handling paths to prevent memory
leaks.

Fix this by using unified exit paths with proper cleanup in the respective
error paths.

Compile tested only. Issue found using a prototype static analysis tool
and code review.

Fixes: 3a415daa3e8b ("wifi: ath11k: add P2P IE in beacon template")
Fixes: 335a92765d30 ("wifi: ath11k: MBSSID beacon support")
Suggested-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260130084451.110768-1-zilin@seu.edu.cn
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/mac.c