From 74b7046d329770ea9dd105ca321ad6abb91bdbbb Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Mon, 21 Nov 2022 12:21:34 +0100 Subject: fs: hfsplus: initialize fsdata in hfsplus_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-5-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/hfsplus/extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/hfsplus') diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index 721f779b4ec3..7a542f3dbe50 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c @@ -554,7 +554,7 @@ void hfsplus_file_truncate(struct inode *inode) if (inode->i_size > hip->phys_size) { struct address_space *mapping = inode->i_mapping; struct page *page; - void *fsdata; + void *fsdata = NULL; loff_t size = inode->i_size; res = hfsplus_write_begin(NULL, mapping, size, 0, -- cgit v1.2.1