Skip to content

Commit

Permalink
NFS: silence a uninitialized variable warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and amschuma-ntap committed Jul 13, 2017
1 parent ce85bd2 commit 4cd1ec9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/nfs4idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4cd1ec9

Please sign in to comment.