Messages in this thread Patch in this message |  | | From | Chenghao Duan <> | | Subject | [PATCH v3 3/7] mm/memfd_luo: remove unnecessary memset in zero-size memfd path | | Date | Thu, 26 Mar 2026 16:47:23 +0800 |
| |
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.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn> --- mm/memfd_luo.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index 2a01eaff03c2..bf827e574bec 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -103,7 +103,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; } -- 2.25.1
|  |