diff options
author | Jan Kara <jack@suse.cz> | 2014-10-23 16:02:47 +0400 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2015-02-02 12:05:19 +0300 |
commit | 6aaa1e03cb296b1824b3150723909d740f6b293e (patch) | |
tree | bf1c9d9564d40312905b034092640486b92da433 /fs/nfs | |
parent | bf5dbba17a6816e0b7f33abc034f5ca089884e10 (diff) | |
download | linux-6aaa1e03cb296b1824b3150723909d740f6b293e.tar.xz |
nfs: Fix use of uninitialized variable in nfs_getattr()
commit 16caf5b6101d03335b386e77e9e14136f989be87 upstream.
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>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 9bb4e5c541b0..a6d59054e8b3 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -512,7 +512,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; /* Flush out writes to the server in order to update c/mtime. */ if (S_ISREG(inode->i_mode)) { |