From: Ping-Ke Shih <pkshih@realtek.com>
To: Zilin Guan <zilin@seu.edu.cn>, <pkshih@realtek.com>
Cc: <kevin_yang@realtek.com>, <linux-wireless@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <jianhao.xu@seu.edu.cn>,
Zilin Guan <zilin@seu.edu.cn>
Subject: Re: [PATCH v2] wifi: rtw89: debug: Fix memory leak in __print_txpwr_map()
Date: Thu, 22 Jan 2026 10:02:29 +0800 [thread overview]
Message-ID: <565d54c7-a2d2-4aed-8389-9df4303afae7@RTKEXHMBS03.realtek.com.tw> (raw)
In-Reply-To: <20260116130834.1413924-1-zilin@seu.edu.cn>
Zilin Guan <zilin@seu.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@realtek.com>
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> Reviewed-by: Zong-Zhe Yang <kevin_yang@realtek.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
prev parent reply other threads:[~2026-01-22 2:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 13:08 Zilin Guan
2026-01-20 3:27 ` Zong-Zhe Yang
2026-01-20 3:31 ` Ping-Ke Shih
2026-01-20 3:39 ` Zong-Zhe Yang
2026-01-22 2:02 ` Ping-Ke Shih [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=565d54c7-a2d2-4aed-8389-9df4303afae7@RTKEXHMBS03.realtek.com.tw \
--to=pkshih@realtek.com \
--cc=jianhao.xu@seu.edu.cn \
--cc=kevin_yang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=zilin@seu.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®