Re: [PATCH wireless-next 3/3] wifi: nxpwifi: zero the channel statistics array

From: Jeff Chen

Date: Tue Sep 08 2026 - 07:03:44 EST


On Thu, Aug 13, 2026 at 04:23:15 PM +0800, Linmao Li wrote:
> adapter->chan_stats comes from vmalloc(), which does not clear the
> memory, and nxpwifi_cfg80211_dump_survey() reads it as soon as user
> space asks for survey data. For the entries no scan has filled in, a
> non-zero cca_scan_dur passes the validity check and stale bytes are
> reported to user space as noise, time and time_busy.
>
> Use kcalloc() instead. The array holds two entries per supported
> channel, small enough not to need vmalloc(), and the two callers change
> to kfree() accordingly.

Reviewed-by: Jeff Chen <jeff.chen_1@xxxxxxx>