Re: [PATCH] audit: Use kzalloc instead of kmalloc/memset

Paul Moore <[email protected]>
Newsgroups org.kernel.vger.audit
Message-ID <[email protected]>
On Nov  5, 2025 Gongwei Li <[email protected]> wrote:
> 
> Replace kmalloc+memset by kzalloc
> for better readability and simplicity.
> 
> This addresses the warning below:
> 
> WARNING: kzalloc should be used for data, instead of kmalloc/memset
> 
> Signed-off-by: Gongwei Li <[email protected]>
> ---
>  kernel/auditfilter.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

This change does result in zero'ing out the trailing string buffer,
which isn't done currently, and shouldn't be necessary, but as this bit
of code isn't performance critical, it should be okay.

Merged into audit/dev, thanks.

--
paul-moore.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.