Skip to content

Commit 4ff3437

Browse files
ramosian-gliderakpm00
authored andcommitted
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/[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]>
1 parent 7df7bdd commit 4ff3437

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/hfsplus/extents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void hfsplus_file_truncate(struct inode *inode)
554554
if (inode->i_size > hip->phys_size) {
555555
struct address_space *mapping = inode->i_mapping;
556556
struct page *page;
557-
void *fsdata;
557+
void *fsdata = NULL;
558558
loff_t size = inode->i_size;
559559

560560
res = hfsplus_write_begin(NULL, mapping, size, 0,

0 commit comments

Comments
 (0)