From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: akpm@linux-foundation.org
Cc: dmitry.torokhov@gmail.com, keescook@chromium.org,
jeyu@redhat.com, rusty@rustcorp.com.au, mmarek@suse.com,
pmladek@suse.com, mbenes@suse.cz, jpoimboe@redhat.com,
ebiederm@xmission.com, shuah@kernel.org,
dan.carpenter@oracle.com, colin.king@canonical.com,
dcb314@hotmail.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Luis R . Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH 1/2] test_kmod: remove paranoid UINT_MAX check on uint range processing
Date: Wed, 2 Aug 2017 14:17:06 -0700 [thread overview]
Message-ID: <20170802211707.28020-2-mcgrof@kernel.org> (raw)
In-Reply-To: <20170802211707.28020-1-mcgrof@kernel.org>
From: Dan Carpenter <dan.carpenter@oracle.com>
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[mcgrof: massaged commit log]
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
lib/test_kmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index ff9148969b92..67fc7b9f41e3 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -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;
mutex_lock(&test_dev->config_mutex);
--
2.11.0
next prev parent reply other threads:[~2017-08-02 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 21:17 [PATCH 0/2] test_kmod: pending patches for v4.14-rc1 Luis R. Rodriguez
2017-08-02 21:17 ` Luis R. Rodriguez [this message]
2017-08-02 21:17 ` [PATCH 2/2] test_kmod: flip INT checks to be consistent Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170802211707.28020-2-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=colin.king@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=dcb314@hotmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=ebiederm@xmission.com \
--cc=jeyu@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mmarek@suse.com \
--cc=pmladek@suse.com \
--cc=rusty@rustcorp.com.au \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.