Commit f520409c authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds
Browse files

test_kmod: remove paranoid UINT_MAX check on uint range processing

The UINT_MAX comparison is not needed because "max" is already an unsigned
int, and we expect developer C code max value input to have a sensible 0 -
UINT_MAX range.  Note that if it so happens to be UINT_MAX + 1 it would
lead to an issue, but we expect the developer to know this.

[ massaged commit log]

Signed-off-by: default avatarDan Carpenter <>
Signed-off-by: Luis Chamberlain's avatarLuis 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: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5680db4b
......@@ -924,7 +924,7 @@ static int test_dev_config_update_uint_range(struct kmod_test_device *test_dev,
if (ret)
return ret;
if (new < min || new > max || new > UINT_MAX)
if (new < min || new > max)
return -EINVAL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment