Bluetooth: L2CAP: Remove bogus NULL checks
The ch pointer is the result of a CONTAINER_OF() operation, so checking it for NULL is pointless. Additionally, there's no place that calls this function with chan set to NULL. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
0e91493ab4
commit
525889c6b5
1 changed files with 2 additions and 2 deletions
|
@ -110,12 +110,12 @@ static struct bt_l2cap_le_chan *l2cap_chan_alloc_cid(struct bt_conn *conn,
|
|||
* No action needed if there's already a CID allocated, e.g. in
|
||||
* the case of a fixed channel.
|
||||
*/
|
||||
if (ch && ch->rx.cid > 0) {
|
||||
if (ch->rx.cid > 0) {
|
||||
return ch;
|
||||
}
|
||||
|
||||
for (cid = L2CAP_LE_CID_DYN_START; cid <= L2CAP_LE_CID_DYN_END; cid++) {
|
||||
if (ch && !bt_l2cap_le_lookup_rx_cid(conn, cid)) {
|
||||
if (!bt_l2cap_le_lookup_rx_cid(conn, cid)) {
|
||||
ch->rx.cid = cid;
|
||||
return ch;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue