diff options
author | Alexander Potapenko <glider@google.com> | 2022-11-21 12:21:33 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-02 22:50:06 -0800 |
commit | e52a418d81fb3c9db187ca9aa519c534b30962a8 (patch) | |
tree | d6ba11a43979c8b34a27d69b2ad6b6f713006f24 /fs/hfs | |
parent | e5576ac8c972a1884950420c3931ddebd018ee9e (diff) | |
download | linux-e52a418d81fb3c9db187ca9aa519c534b30962a8.tar.gz linux-e52a418d81fb3c9db187ca9aa519c534b30962a8.tar.bz2 linux-e52a418d81fb3c9db187ca9aa519c534b30962a8.zip |
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>
Diffstat (limited to 'fs/hfs')
-rw-r--r-- | fs/hfs/extent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index 3f7e9bef9874..6d1878b99b30 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c @@ -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? */ |