[PATCH] fs/ext4: Remove unnecessary zero-initialization via memset

From: Donglin Peng

Date: Thu Dec 11 2025 - 07:38:35 EST


From: pengdonglin <pengdonglin@xxxxxxxxxx>

The d_path function does not require the caller to pre-zero the
buffer.

Signed-off-by: pengdonglin <pengdonglin@xxxxxxxxxx>
---
fs/ext4/file.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 7a8b30932189..484cb7388802 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -858,7 +858,6 @@ static int ext4_sample_last_mounted(struct super_block *sb,
* when trying to sort through large numbers of block
* devices or filesystem images.
*/
- memset(buf, 0, sizeof(buf));
path.mnt = mnt;
path.dentry = mnt->mnt_root;
cp = d_path(&path, buf, sizeof(buf));
--
2.34.1