From 26f260ce5828fc7897a70629884916301f5825d0 Mon Sep 17 00:00:00 2001 From: pengdonglin Date: Thu, 11 Dec 2025 20:38:29 +0800 Subject: [PATCH] ext4: remove unnecessary zero-initialization via memset The d_path function does not require the caller to pre-zero the buffer. Signed-off-by: pengdonglin Reviewed-by: Zhang Yi Reviewed-by: Baokun Li Link: https://patch.msgid.link/20251211123829.2777009-1-dolinux.peng@gmail.com Signed-off-by: Theodore Ts'o --- fs/ext4/file.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 7a8b309321892..484cb73888024 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.47.3