summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2023-01-10 13:49:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-01 08:23:11 +0100
commit39ab0fc4984285851048716e7f85ef8b11cabf11 (patch)
tree8b09f0f56068ac628dac4a9250df7f79fcd42230 /fs
parentf6fa12fbb17cdd46d6f981634dd502840df2d3ea (diff)
affs: initialize fsdata in affs_truncate()
[ Upstream commit eef034ac6690118c88f357b00e2b3239c9d8575d ] When aops->write_begin() does not initialize fsdata, KMSAN may report an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Fixes: f2b6a16eb8f5 ("fs: affs convert to new aops") Suggested-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Alexander Potapenko <glider@google.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/affs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c
index d91b0133d95d..c3d89fa1bab7 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -879,7 +879,7 @@ affs_truncate(struct inode *inode)
if (inode->i_size > AFFS_I(inode)->mmu_private) {
struct address_space *mapping = inode->i_mapping;
struct page *page;
- void *fsdata;
+ void *fsdata = NULL;
loff_t isize = inode->i_size;
int res;