Commit 4aa6424f authored by Chenghao Duan's avatar Chenghao Duan Committed by Andrew Morton
Browse files

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: default avatarChenghao Duan <duanchenghao@kylinos.cn>
Reviewed-by: default avatarPratyush Yadav <pratyush@kernel.org>
Reviewed-by: default avatarPasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: default avatarMike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Haoran Jiang <jianghaoran@kylinos.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 502d3c2a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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;
	}