HomeFreeBSD

Cleanup: Use kmem_zalloc() instead of memset() to zero memory

Description

Cleanup: Use kmem_zalloc() instead of memset() to zero memory

The Linux 5.16.14 kernel's coccicheck caught this. The semantic patch
that caught it was:

./scripts/coccinelle/api/alloc/zalloc-simple.cocci

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14372

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Jan 10 2023, 7:06 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 12 2023, 11:59 PM
Parents
rG7384ec65cd6b: Cleanup: Remove unnecessary explicit casts of pointers from allocators
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGc9c3ce79765d: Cleanup: Use kmem_zalloc() instead of memset() to zero memory (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Jan 12 2023, 11:59 PM