From: Alexander Potapenko Date: Tue, 10 Jan 2023 12:49:30 +0000 (+0100) Subject: affs: initialize fsdata in affs_truncate() X-Git-Tag: v5.15.92~199 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7a479c76481f85f8b39a59c9aff4737b761158c;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Alexander Potapenko Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- diff --git a/fs/affs/file.c b/fs/affs/file.c index 75ebd2b..25d480e 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -881,7 +881,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;