diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-04-29 19:35:43 +0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-06-23 00:23:49 +0100 |
commit | 5ee9891dd8a63df1bf2ccd437872ad30a5850449 (patch) | |
tree | 7ef219c2f84595edfbf6b39eef69a0797a05732d /drivers/oprofile | |
parent | af1c01349ecc2b8ab2c329e4dbd46e9018469bd1 (diff) |
Bluetooth: Simplify hci_conn_hold/drop logic for L2CAP
The L2CAP code has been incrementing the hci_conn reference for each
l2cap_chan instance in the l2cap_conn list. Likewise, the reference is
dropped each time an l2cap_chan is removed from the list. The reference
counting policy with respect to removal has been clear and explicit in
the l2cap_chan_del function, however for addition the function
calling 2cap_chan_add has always had to do a separate hci_conn_hold
call.
What made the counting even more hard to follow is that the
hci_connect() procedure increments the reference and the L2CAP layer
making this call took advantage of it to use it as its own reference.
This patch aims to clarify things by having the call to hci_conn_hold
inside __l2cap_chan_add, thereby removing the need to do it in the
functions calling __l2cap_chan_add. The reference count for hci_connect
is still kept as it's necessary for users such as mgmt_pair_device,
however for the L2CAP layer it means that an extra call to hci_conn_drop
must be performed once l2cap_chan_add has been done.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'drivers/oprofile')
0 files changed, 0 insertions, 0 deletions