Skip to content

Commit 8da059f

Browse files
Dan CarpenterMiklos Szeredi
authored andcommitted
fuse: Uninitialized variable in fuse_epoch_work()
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: 64becd2 ("fuse: new work queue to invalidate dentries from old epochs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Luis Henriques <luis@igalia.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 95c39ee commit 8da059f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/fuse/dir.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ void fuse_epoch_work(struct work_struct *work)
199199
down_read(&fc->killsb);
200200

201201
inode = fuse_ilookup(fc, FUSE_ROOT_ID, &fm);
202-
iput(inode);
203-
204-
if (fm) {
202+
if (inode) {
203+
iput(inode);
205204
/* Remove all possible active references to cached inodes */
206205
shrink_dcache_sb(fm->sb);
207206
} else

0 commit comments

Comments
 (0)