]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: remove unnecessary zero-initialization via memset
authorpengdonglin <pengdonglin@xiaomi.com>
Thu, 11 Dec 2025 12:38:29 +0000 (20:38 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 20 Jan 2026 01:13:57 +0000 (20:13 -0500)
The d_path function does not require the caller to pre-zero the
buffer.

Signed-off-by: pengdonglin <pengdonglin@xiaomi.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Link: https://patch.msgid.link/20251211123829.2777009-1-dolinux.peng@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/file.c

index 7a8b3093218921f26a7f8962f94739ba49431230..484cb73888024879c70d1104f495fc635e42af07 100644 (file)
@@ -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));