Commit 8da059f2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Miklos Szeredi
Browse files

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: 64becd22 ("fuse: new work queue to invalidate dentries from old epochs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarLuis Henriques <luis@igalia.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 95c39eef
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -199,9 +199,8 @@ void fuse_epoch_work(struct work_struct *work)
	down_read(&fc->killsb);

	inode = fuse_ilookup(fc, FUSE_ROOT_ID, &fm);
	if (inode) {
		iput(inode);

	if (fm) {
		/* Remove all possible active references to cached inodes */
		shrink_dcache_sb(fm->sb);
	} else