summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-09-08 16:16:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-08 18:26:50 -0700
commit52c270d358b636d332114ac31e572970c5d0c4df (patch)
treed4927fb895a83d90a5bdb8062c7da682086dc748 /lib
parentf520409cfd3844660cedef8dc560ed0443e7f192 (diff)
downloadlinux-52c270d358b636d332114ac31e572970c5d0c4df.tar.bz2
test_kmod: flip INT checks to be consistent
Most checks will check for min and then max, except the int check. Flip the checks to be consistent with the other code. [mcgrof@kernel.org: massaged commit log] Link: http://lkml.kernel.org/r/20170802211707.28020-3-mcgrof@kernel.org Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Kees Cook <keescook@chromium.org> Cc: Jessica Yu <jeyu@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Michal Marek <mmarek@suse.com> Cc: Petr Mladek <pmladek@suse.com> Cc: Miroslav Benes <mbenes@suse.cz> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Colin Ian King <colin.king@canonical.com> Cc: David Binderman <dcb314@hotmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/test_kmod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 67fc7b9f41e3..fba78d25e825 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -946,7 +946,7 @@ static int test_dev_config_update_int(struct kmod_test_device *test_dev,
if (ret)
return ret;
- if (new > INT_MAX || new < INT_MIN)
+ if (new < INT_MIN || new > INT_MAX)
return -EINVAL;
mutex_lock(&test_dev->config_mutex);