From e52a418d81fb3c9db187ca9aa519c534b30962a8 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Mon, 21 Nov 2022 12:21:33 +0100 Subject: fs: hfs: initialize fsdata in hfs_file_truncate() 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. Link: https://lkml.kernel.org/r/20221121112134.407362-4-glider@google.com Signed-off-by: Alexander Potapenko Suggested-by: Eric Biggers Cc: Andreas Dilger Cc: Chao Yu Cc: Jaegeuk Kim Cc: Theodore Ts'o Signed-off-by: Andrew Morton --- fs/hfs/extent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/hfs') diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index 3f7e9bef9874..6d1878b99b30 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c @@ -486,7 +486,7 @@ void hfs_file_truncate(struct inode *inode) inode->i_size); if (inode->i_size > HFS_I(inode)->phys_size) { struct address_space *mapping = inode->i_mapping; - void *fsdata; + void *fsdata = NULL; struct page *page; /* XXX: Can use generic_cont_expand? */ -- cgit