Skip to content

Commit

Permalink
nfs: Fix use of uninitialized variable in nfs_getattr()
Browse files Browse the repository at this point in the history
Variable 'err' needn't be initialized when nfs_getattr() uses it to
check whether it should call generic_fillattr() or not. That can result
in spurious error returns. Initialize 'err' properly.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Jan Kara authored and Trond Myklebust committed Nov 12, 2014
1 parent b283f94 commit 16caf5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
int err;
int err = 0;

trace_nfs_getattr_enter(inode);
/* Flush out writes to the server in order to update c/mtime. */
Expand Down

0 comments on commit 16caf5b

Please sign in to comment.