diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 3959f23c487a..1c8c5f238a67 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -1284,6 +1284,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir, goto out1; } + memset(new_de, 0, PATH_MAX); /* Avoid any operation if inode is bad. */ if (unlikely(is_bad_ni(dir_ni))) { err = -EINVAL; @@ -1723,6 +1724,7 @@ int ntfs_link_inode(struct inode *inode, struct dentry *dentry) if (!de) return -ENOMEM; + memset(de, 0, PATH_MAX); /* Mark rw ntfs as dirty. It will be cleared at umount. */ ntfs_set_state(sbi, NTFS_DIRTY_DIRTY); @@ -1761,6 +1763,7 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry) if (!de) return -ENOMEM; + memset(de, 0, PATH_MAX); ni_lock(ni); if (S_ISDIR(inode->i_mode) && !dir_is_empty(inode)) {