projects/linux·commit 8da059f2

fuse: Uninitialized variable in fuse_epoch_work()

8da059f2 · Dan Carpenter <[email protected]> · 2025-11-24 09:04:56 +03:00

The fuse_ilookup() function only sets *fm on the success path so this
"if (fm) {" NULL check doesn't work.  The "fm" pointer is either
uninitialized or valid.  Check the "inode" pointer instead.

Also, while it's not necessary, it is cleaner to move the iput(inode)
under the NULL check as well.

Fixes: 64becd224ff9 ("fuse: new work queue to invalidate dentries from old epochs")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Luis Henriques <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Commit
8da059f2a497a2427150faae5adc3bb78e73b3e2
Parents
95c39eef

Changes

1 files changed · +2 −3

FileStatusAddDelContent
fs/fuse/dir.cmodified+2−3View file

fs/fuse/dir.c

View file
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 963f53f..2aec225 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -199,9 +199,8 @@ void fuse_epoch_work(struct work_struct *work)
down_read(&fc->killsb);
inode = fuse_ilookup(fc, FUSE_ROOT_ID, &fm);
- iput(inode);
-
- if (fm) {
+ if (inode) {
+ iput(inode);
/* Remove all possible active references to cached inodes */
shrink_dcache_sb(fm->sb);
} else