From: Colin King <colin.king@canonical.com>
To: Alexander Aring <alex.aring@gmail.com>,
Jukka Rissanen <jukka.rissanen@linux.intel.com>,
"David S . Miller" <davem@davemloft.net>,
linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org,
netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE
Date: Mon, 24 Jun 2019 15:47:57 +0100 [thread overview]
Message-ID: <20190624144757.1285-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
The WARN_ON_ONCE check on id is off-by-one, it should be greater or equal
to LOWPAN_IPHC_CTX_TABLE_SIZE and not greater than. Fix this.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/6lowpan/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
index 1c140af06d52..a510bed8165b 100644
--- a/net/6lowpan/debugfs.c
+++ b/net/6lowpan/debugfs.c
@@ -170,7 +170,7 @@ static void lowpan_dev_debugfs_ctx_init(struct net_device *dev,
struct dentry *root;
char buf[32];
- WARN_ON_ONCE(id > LOWPAN_IPHC_CTX_TABLE_SIZE);
+ WARN_ON_ONCE(id >= LOWPAN_IPHC_CTX_TABLE_SIZE);
sprintf(buf, "%d", id);
--
2.20.1
next reply other threads:[~2019-06-24 14:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 14:47 Colin King [this message]
2019-07-06 10:51 ` [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE Marcel Holtmann
2019-07-06 23:23 ` Colin Ian King
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=20190624144757.1285-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=jukka.rissanen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).