[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260116121145.1370320-1-zilin@seu.edu.cn>
Date: Fri, 16 Jan 2026 12:11:45 +0000
From: Zilin Guan <zilin@....edu.cn>
To: kevin_yang@...ltek.com
Cc: jianhao.xu@....edu.cn,
linux-kernel@...r.kernel.org,
linux-wireless@...r.kernel.org,
pkshih@...ltek.com,
zilin@....edu.cn
Subject: RE: [PATCH] wifi: rtw89: debug: Fix memory leak in __print_txpwr_map()
On Fri, Jan 16, 2026 at 08:23:57AM +0000, Zong-Zhe Yang wrote:
> > @@ -834,8 +834,10 @@ static ssize_t __print_txpwr_map(struct rtw89_dev *rtwdev, char
> > *buf, size_t buf
> > else
> > max_valid_addr = map->addr_to;
> >
> > - if (max_valid_addr == 0)
> > + if (max_valid_addr == 0) {
> > + vfree(bufp);
> > return -EOPNOTSUPP;
> > + }
>
> Thank you for catching this.
> Since the decision for max_valid_addr doesn't depend on bufp,
> how about moving vzalloc down here ?
>
> >
> > for (addr = map->addr_from; addr <= max_valid_addr; addr += 4) {
> > ret = rtw89_mac_txpwr_read32(rtwdev, RTW89_PHY_0, addr, &val);
> > --
> > 2.34.1
> >
Thanks for your suggestion. I agree that moving vzalloc() after the check
is a cleaner solution. I will send a v2 patch to address this.
Best Regards,
Zilin Guan
Powered by blists - more mailing lists