mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-03 19:53:32 +00:00
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>
This commit is contained in:
parent
e5576ac8c9
commit
e52a418d81
@ -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? */
|
||||
|
Loading…
Reference in New Issue
Block a user