aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Potapenko <[email protected]>2022-11-21 12:21:34 +0100
committerAndrew Morton <[email protected]>2023-02-02 22:50:06 -0800
commit74b7046d329770ea9dd105ca321ad6abb91bdbbb (patch)
tree3d37d6945298fea71baeaaaaa4b5b576ad493d53
parente52a418d81fb3c9db187ca9aa519c534b30962a8 (diff)
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]>
-rw-r--r--fs/hfsplus/extents.c2
1 files changed, 1 insertions, 1 deletions
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,