From: Chenghao Duan Date: Thu, 26 Mar 2026 08:47:23 +0000 (+0800) Subject: mm/memfd_luo: remove unnecessary memset in zero-size memfd path X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4aa6424f37b58a4f8298329166657bd4fd8e9ca8;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Pratyush Yadav Reviewed-by: Pasha Tatashin Reviewed-by: Mike Rapoport (Microsoft) Cc: Haoran Jiang Signed-off-by: Andrew Morton --- diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index 865b044bee62..5a8ead5be087 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -105,7 +105,6 @@ static int memfd_luo_preserve_folios(struct file *file, if (!size) { *nr_foliosp = 0; *out_folios_ser = NULL; - memset(kho_vmalloc, 0, sizeof(*kho_vmalloc)); return 0; }