Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 379ebf07 authored by Dan Carpenter's avatar Dan Carpenter Committed by Anna Schumaker
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 016583d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;