diff options
-rw-r--r-- | net/bluetooth/hci_core.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ed60d37ea646..0d3782ad9a5b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -3726,15 +3726,8 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, | |||
3726 | return 0; | 3726 | return 0; |
3727 | } | 3727 | } |
3728 | 3728 | ||
3729 | /* This function requires the caller holds hdev->lock */ | 3729 | static void hci_conn_params_free(struct hci_conn_params *params) |
3730 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type) | ||
3731 | { | 3730 | { |
3732 | struct hci_conn_params *params; | ||
3733 | |||
3734 | params = hci_conn_params_lookup(hdev, addr, addr_type); | ||
3735 | if (!params) | ||
3736 | return; | ||
3737 | |||
3738 | if (params->conn) { | 3731 | if (params->conn) { |
3739 | hci_conn_drop(params->conn); | 3732 | hci_conn_drop(params->conn); |
3740 | hci_conn_put(params->conn); | 3733 | hci_conn_put(params->conn); |
@@ -3743,6 +3736,18 @@ void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type) | |||
3743 | list_del(¶ms->action); | 3736 | list_del(¶ms->action); |
3744 | list_del(¶ms->list); | 3737 | list_del(¶ms->list); |
3745 | kfree(params); | 3738 | kfree(params); |
3739 | } | ||
3740 | |||
3741 | /* This function requires the caller holds hdev->lock */ | ||
3742 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type) | ||
3743 | { | ||
3744 | struct hci_conn_params *params; | ||
3745 | |||
3746 | params = hci_conn_params_lookup(hdev, addr, addr_type); | ||
3747 | if (!params) | ||
3748 | return; | ||
3749 | |||
3750 | hci_conn_params_free(params); | ||
3746 | 3751 | ||
3747 | hci_update_background_scan(hdev); | 3752 | hci_update_background_scan(hdev); |
3748 | 3753 | ||
@@ -3769,15 +3774,8 @@ void hci_conn_params_clear_all(struct hci_dev *hdev) | |||
3769 | { | 3774 | { |
3770 | struct hci_conn_params *params, *tmp; | 3775 | struct hci_conn_params *params, *tmp; |
3771 | 3776 | ||
3772 | list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) { | 3777 | list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) |
3773 | if (params->conn) { | 3778 | hci_conn_params_free(params); |
3774 | hci_conn_drop(params->conn); | ||
3775 | hci_conn_put(params->conn); | ||
3776 | } | ||
3777 | list_del(¶ms->action); | ||
3778 | list_del(¶ms->list); | ||
3779 | kfree(params); | ||
3780 | } | ||
3781 | 3779 | ||
3782 | hci_update_background_scan(hdev); | 3780 | hci_update_background_scan(hdev); |
3783 | 3781 | ||