summaryrefslogtreecommitdiff
path: root/tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorZilin Guan <zilin@seu.edu.cn>2026-01-16 13:08:34 +0000
committerPing-Ke Shih <pkshih@realtek.com>2026-01-22 09:58:37 +0800
commit6070a44051b1c35714fa130de7726cfe91ca5559 (patch)
tree911806da41992b13ad42a9d2ba8b6f3bc38464ef /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
parent5f65ebf9aaf00c7443252136066138435ec03958 (diff)
wifi: rtw89: debug: Fix memory leak in __print_txpwr_map()
In __print_txpwr_map(), memory is allocated to bufp via vzalloc(). If max_valid_addr is 0, the function returns -EOPNOTSUPP immediately without freeing bufp, leading to a memory leak. Since the validation of max_valid_addr does not depend on the allocated memory, fix this by moving the vzalloc() call after the check. Compile tested only. Issue found using a prototype static analysis tool and code review. Fixes: 036042e15770 ("wifi: rtw89: debug: txpwr table supports Wi-Fi 7 chips") Suggested-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Zilin Guan <zilin@seu.edu.cn> Reviewed-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20260116130834.1413924-1-zilin@seu.edu.cn
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions