Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/memfd_luo: remove unnecessary memset in zero-size memfd path

The memset(kho_vmalloc, 0, sizeof(*kho_vmalloc)) call in the zero-size
file handling path is unnecessary because the allocation of the ser
structure already uses the __GFP_ZERO flag, ensuring the memory is already
zero-initialized.

Link: https://lore.kernel.org/20260326084727.118437-4-duanchenghao@kylinos.cn
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Haoran Jiang <jianghaoran@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Chenghao Duan and committed by
Andrew Morton
4aa6424f 502d3c2a

-1
-1
mm/memfd_luo.c
··· 105 105 if (!size) { 106 106 *nr_foliosp = 0; 107 107 *out_folios_ser = NULL; 108 - memset(kho_vmalloc, 0, sizeof(*kho_vmalloc)); 109 108 return 0; 110 109 } 111 110