Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
fs: hfs: initialize fsdata in hfs_file_truncate()
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Alexander Potapenko <[email protected]>
Suggested-by: Eric Biggers <[email protected]>
Cc: Andreas Dilger <[email protected]>
Cc: Chao Yu <[email protected]>
Cc: Jaegeuk Kim <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
ramosian-glider authored and akpm00 committed Feb 3, 2023
1 parent e5576ac commit e52a418
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/hfs/extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down

0 comments on commit e52a418

Please sign in to comment.