NFS: silence a uninitialized variable warning

Static checkers have gotten clever enough to complain that "id_long" is
uninitialized on the failure path.  It's harmless, but simple to fix.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Dan Carpenter 2017-06-23 18:16:25 +03:00 committed by Anna Schumaker
parent ce85bd2921
commit 4cd1ec95bd
1 changed files with 2 additions and 1 deletions

View File

@ -364,7 +364,8 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen, const char *typ
ret = -EINVAL;
} else {
ret = kstrtol(id_str, 10, &id_long);
*id = (__u32)id_long;
if (!ret)
*id = (__u32)id_long;
}
return ret;
}