diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-02 07:39:16 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-11-04 22:04:07 -0500 |
commit | ab0c127fbb21c19adb34b78ba26b84748d0cd4de (patch) | |
tree | 99e6f929f8089f69cf43540f01dda1800cfef8ac | |
parent | 8a7889cc6e2dbbace114130f4efd9b77452069cd (diff) |
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: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/l2cap_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 8fd36f59dcde..fdb7989e2997 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -239,7 +239,7 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn) | |||
239 | else | 239 | else |
240 | dyn_end = L2CAP_CID_DYN_END; | 240 | dyn_end = L2CAP_CID_DYN_END; |
241 | 241 | ||
242 | for (cid = L2CAP_CID_DYN_START; cid < dyn_end; cid++) { | 242 | for (cid = L2CAP_CID_DYN_START; cid <= dyn_end; cid++) { |
243 | if (!__l2cap_get_chan_by_scid(conn, cid)) | 243 | if (!__l2cap_get_chan_by_scid(conn, cid)) |
244 | return cid; | 244 | return cid; |
245 | } | 245 | } |