Skip to content

Commit bcbb655

Browse files
Johan Hedbergholtmann
authored andcommitted
Bluetooth: Remove hci_conn_hold/drop from hci_chan
We can't have hci_chan contribute to the "active" reference counting of the hci_conn since otherwise the connection would never get dropped when there are no more users (since hci_chan would be counted as a user). This patch removes hold() when creating the hci_chan and drop() when destroying it. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent f94b665 commit bcbb655

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

net/bluetooth/hci_conn.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,6 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)
13011301
return NULL;
13021302

13031303
chan->conn = hci_conn_get(conn);
1304-
hci_conn_hold(conn);
13051304
skb_queue_head_init(&chan->data_q);
13061305
chan->state = BT_CONNECTED;
13071306

@@ -1321,11 +1320,9 @@ void hci_chan_del(struct hci_chan *chan)
13211320

13221321
synchronize_rcu();
13231322

1324-
/* Force the connection to be immediately dropped */
1325-
conn->disc_timeout = 0;
1323+
/* Prevent new hci_chan's to be created for this hci_conn */
13261324
set_bit(HCI_CONN_DROP, &conn->flags);
13271325

1328-
hci_conn_drop(conn);
13291326
hci_conn_put(conn);
13301327

13311328
skb_queue_purge(&chan->data_q);

0 commit comments

Comments
 (0)