Skip to content

Commit

Permalink
fs: hfsplus: initialize fsdata in hfsplus_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/20221121112134.407362-5-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>
  • Loading branch information
ramosian-glider authored and akpm00 committed Feb 3, 2023
1 parent e52a418 commit 74b7046
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/hfsplus/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 74b7046

Please sign in to comment.