提交 ab0c127f 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

Bluetooth: L2CAP: Fix checked range when allocating new CID

The 'dyn_end' value is also a valid CID so it should be included in
the range of values checked.
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 8a7889cc
...@@ -239,7 +239,7 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn) ...@@ -239,7 +239,7 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
else else
dyn_end = L2CAP_CID_DYN_END; dyn_end = L2CAP_CID_DYN_END;
for (cid = L2CAP_CID_DYN_START; cid < dyn_end; cid++) { for (cid = L2CAP_CID_DYN_START; cid <= dyn_end; cid++) {
if (!__l2cap_get_chan_by_scid(conn, cid)) if (!__l2cap_get_chan_by_scid(conn, cid))
return cid; return cid;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册