From: "Jεan Sacren" <sakiwit@gmail.com>
To: marcel@holtmann.org, johan.hedberg@gmail.com,
luiz.dentz@gmail.com, davem@davemloft.net, kuba@kernel.org,
linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH net-next] net: bluetooth: clean up harmless false expression
Date: Wed, 8 Dec 2021 00:20:24 -0700 [thread overview]
Message-ID: <20211208024732.142541-4-sakiwit@gmail.com> (raw)
From: Jean Sacren <sakiwit@gmail.com>
scid is u16 with a range from 0x0000 to 0xffff. L2CAP_CID_DYN_END is
0xffff. We should drop the false check of (scid > L2CAP_CID_DYN_END).
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
net/bluetooth/l2cap_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4f8f37599962..fe5f455646f6 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4118,7 +4118,7 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn,
result = L2CAP_CR_NO_MEM;
/* Check for valid dynamic CID range (as per Erratum 3253) */
- if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_DYN_END) {
+ if (scid < L2CAP_CID_DYN_START) {
result = L2CAP_CR_INVALID_SCID;
goto response;
}
next reply other threads:[~2021-12-08 7:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 7:20 Jεan Sacren [this message]
2021-12-08 14:39 ` [PATCH net-next] net: bluetooth: clean up harmless false expression Marcel Holtmann
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=20211208024732.142541-4-sakiwit@gmail.com \
--to=sakiwit@gmail.com \
--cc=davem@davemloft.net \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.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