From: Alexander Potapenko Date: Tue, 10 Jan 2023 12:49:30 +0000 (+0100) Subject: affs: initialize fsdata in affs_truncate() X-Git-Tag: baikal/aarch64/sdk5.9~119 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=087d3ae22c811f163d6f24aaa1ebc72d4da130a3;p=kernel.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: 72631fe02974 ("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 ba084b0b214b9..82bb38370aa9a 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -878,7 +878,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;