aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Drokin <green@linuxhacker.ru>2015-07-13 23:17:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-13 20:52:55 -0700
commitaa66d6f87f300b15ac2efdcde9e198bf5a9020ce (patch)
tree8db2d700ddd88bf56292c2576e6984defc89e06e
parentstaging/lustre/libcfs: remove unused portal_enter_debugger variable (diff)
staging/lustre/libcfs: Fix kstrtouint return value check fix
Apparently kstrtouint could return not just -EINVAL, but also -ERANGE, so make sure we just check the return value for something negative. Noticed by Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/libcfs/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c
index 63468870f230..e93f556fac0d 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -185,7 +185,7 @@ static int param_set_uint_minmax(const char *val,
if (!val)
return -EINVAL;
ret = kstrtouint(val, 0, &num);
- if (ret == -EINVAL || num < min || num > max)
+ if (ret < 0 || num < min || num > max)
return -EINVAL;
*((unsigned int *)kp->arg) = num;
return 0;