diff options
| author | Chenghao Duan <duanchenghao@kylinos.cn> | 2026-03-26 16:47:23 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-04-18 00:10:52 -0700 |
| commit | 4aa6424f37b58a4f8298329166657bd4fd8e9ca8 (patch) | |
| tree | ff82b0dd6a340e9e0f964f93d9a2119132fac132 /mm | |
| parent | 502d3c2ad8f05d1545ae05f96f71a5916aa88b0f (diff) | |
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>
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/memfd_luo.c | 1 |
1 files changed, 0 insertions, 1 deletions
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; } |
