aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-07-12 15:29:29 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-07-31 12:53:40 -0400
commit379ebf0796071210c61ea17ba3f08cbc5e260894 (patch)
treefff4899488b81c1ab5d301a06017552d9722668f /fs/nfs
parentsunrpc: Change rpc_print_iostats to rpc_clnt_show_stats and handle rpc_clnt clones (diff)
downloadlinux-dev-379ebf0796071210c61ea17ba3f08cbc5e260894.tar.xz
linux-dev-379ebf0796071210c61ea17ba3f08cbc5e260894.zip
NFS: silence a harmless uninitialized variable warning
kstrtoul() can return -ERANGE so Smatch complains that "num" can be uninitialized. We check that it's within bounds so it's not a huge deal. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index bdf39fa1bfbc..ac4b2f005778 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2899,7 +2899,7 @@ static int param_set_portnr(const char *val, const struct kernel_param *kp)
if (!val)
return -EINVAL;
ret = kstrtoul(val, 0, &num);
- if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR)
+ if (ret || num > NFS_CALLBACK_MAXPORTNR)
return -EINVAL;
*((unsigned int *)kp->arg) = num;
return 0;