From: Dan Carpenter Date: Fri, 8 Sep 2017 23:16:57 +0000 (-0700) Subject: test_kmod: flip INT checks to be consistent X-Git-Tag: v4.14-rc1~83^2~17 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=52c270d358b636d332114ac31e572970c5d0c4df 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 Signed-off-by: Luis R. Rodriguez Cc: Dmitry Torokhov Cc: Kees Cook Cc: Jessica Yu Cc: Rusty Russell Cc: Michal Marek Cc: Petr Mladek Cc: Miroslav Benes Cc: Josh Poimboeuf Cc: Eric W. Biederman Cc: Shuah Khan Cc: Colin Ian King Cc: David Binderman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);