[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <565d54c7-a2d2-4aed-8389-9df4303afae7@RTKEXHMBS03.realtek.com.tw>
Date: Thu, 22 Jan 2026 10:02:29 +0800
From: Ping-Ke Shih <pkshih@...ltek.com>
To: Zilin Guan <zilin@....edu.cn>, <pkshih@...ltek.com>
CC: <kevin_yang@...ltek.com>, <linux-wireless@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <jianhao.xu@....edu.cn>,
Zilin Guan
<zilin@....edu.cn>
Subject: Re: [PATCH v2] wifi: rtw89: debug: Fix memory leak in __print_txpwr_map()
Zilin Guan <zilin@....edu.cn> wrote:
> 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@...ltek.com>
> Signed-off-by: Zilin Guan <zilin@....edu.cn>
> Reviewed-by: Zong-Zhe Yang <kevin_yang@...ltek.com>
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
6070a44051b1 wifi: rtw89: debug: Fix memory leak in __print_txpwr_map()
---
https://github.com/pkshih/rtw.git
Powered by blists - more mailing lists