Skip to content

Commit e52a418

Browse files
ramosian-gliderakpm00
authored andcommitted
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 <glider@google.com> Suggested-by: Eric Biggers <ebiggers@kernel.org> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: Chao Yu <chao@kernel.org> Cc: Jaegeuk Kim <jaegeuk@kernel.org> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent e5576ac commit e52a418

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/hfs/extent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ void hfs_file_truncate(struct inode *inode)
486486
inode->i_size);
487487
if (inode->i_size > HFS_I(inode)->phys_size) {
488488
struct address_space *mapping = inode->i_mapping;
489-
void *fsdata;
489+
void *fsdata = NULL;
490490
struct page *page;
491491

492492
/* XXX: Can use generic_cont_expand? */

0 commit comments

Comments
 (0)