aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-18 13:33:27 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:54 -0400
commitbcbb655a180344d8004ede669228992bff1921e4 (patch)
tree10abc4c141ed33a522ee725b8d492178e0c9214d
parentf94b665dcf15324f5ac8aa639e47be0829b6409d (diff)
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>
-rw-r--r--net/bluetooth/hci_conn.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index aaa7e388d026..5157a0990732 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1301,7 +1301,6 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)
1301 return NULL; 1301 return NULL;
1302 1302
1303 chan->conn = hci_conn_get(conn); 1303 chan->conn = hci_conn_get(conn);
1304 hci_conn_hold(conn);
1305 skb_queue_head_init(&chan->data_q); 1304 skb_queue_head_init(&chan->data_q);
1306 chan->state = BT_CONNECTED; 1305 chan->state = BT_CONNECTED;
1307 1306
@@ -1321,11 +1320,9 @@ void hci_chan_del(struct hci_chan *chan)
1321 1320
1322 synchronize_rcu(); 1321 synchronize_rcu();
1323 1322
1324 /* Force the connection to be immediately dropped */ 1323 /* Prevent new hci_chan's to be created for this hci_conn */
1325 conn->disc_timeout = 0;
1326 set_bit(HCI_CONN_DROP, &conn->flags); 1324 set_bit(HCI_CONN_DROP, &conn->flags);
1327 1325
1328 hci_conn_drop(conn);
1329 hci_conn_put(conn); 1326 hci_conn_put(conn);
1330 1327
1331 skb_queue_purge(&chan->data_q); 1328 skb_queue_purge(&chan->data_q);