aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-17 16:28:57 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:53 -0400
commitf8aaf9b65a77267f749c1af641e46c3457d50701 (patch)
treede1e0c30c71feca081078fe6a23daa5703759d94 /net/bluetooth/hci_event.c
parent51bb8457ddfa74ede52bf8c02054dea831d59fff (diff)
Bluetooth: Fix using hci_conn_get() for hci_conn pointers
Wherever we keep hci_conn pointers around we should be using hci_conn_get/put to ensure that they stay valid. This patch fixes all places violating against the principle currently. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d2ee162ecddb..e6a496ae0318 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4231,6 +4231,7 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
4231 list_del_init(&params->action); 4231 list_del_init(&params->action);
4232 if (params->conn) { 4232 if (params->conn) {
4233 hci_conn_drop(params->conn); 4233 hci_conn_drop(params->conn);
4234 hci_conn_put(params->conn);
4234 params->conn = NULL; 4235 params->conn = NULL;
4235 } 4236 }
4236 } 4237 }
@@ -4322,7 +4323,7 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
4322 * the parameters get removed and keep the reference 4323 * the parameters get removed and keep the reference
4323 * count consistent once the connection is established. 4324 * count consistent once the connection is established.
4324 */ 4325 */
4325 params->conn = conn; 4326 params->conn = hci_conn_get(conn);
4326 return; 4327 return;
4327 } 4328 }
4328 4329