diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-15 04:51:28 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-15 04:59:30 -0400 |
commit | 2d3c2260e7ef0b21f7f0db0fbfee0b092e1202f8 (patch) | |
tree | 2537a66f6f51ab282ec12203a6e231d0f2a02cf0 /net/bluetooth | |
parent | 3a19b6feb26295fe03c9242a72084d2f32dcaac4 (diff) |
Bluetooth: Don't try to reject failed LE connections
The check for the blacklist in hci_le_conn_complete_evt() should be when
we know that we have an actual successful connection (ev->status being
non-zero). This patch fixes this ordering.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_event.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index bf2926b2e4a9..68d335e193bf 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -4187,14 +4187,14 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
4187 | else | 4187 | else |
4188 | addr_type = BDADDR_LE_RANDOM; | 4188 | addr_type = BDADDR_LE_RANDOM; |
4189 | 4189 | ||
4190 | /* Drop the connection if he device is blocked */ | 4190 | if (ev->status) { |
4191 | if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) { | 4191 | hci_le_conn_failed(conn, ev->status); |
4192 | hci_conn_drop(conn); | ||
4193 | goto unlock; | 4192 | goto unlock; |
4194 | } | 4193 | } |
4195 | 4194 | ||
4196 | if (ev->status) { | 4195 | /* Drop the connection if the device is blocked */ |
4197 | hci_le_conn_failed(conn, ev->status); | 4196 | if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) { |
4197 | hci_conn_drop(conn); | ||
4198 | goto unlock; | 4198 | goto unlock; |
4199 | } | 4199 | } |
4200 | 4200 | ||