From: Jan Kara Date: Thu, 23 Oct 2014 12:02:47 +0000 (+0200) Subject: nfs: Fix use of uninitialized variable in nfs_getattr() X-Git-Tag: v3.4.106~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6aaa1e03cb296b1824b3150723909d740f6b293e;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: Trond Myklebust Signed-off-by: Zefan Li --- 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)) {