aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-15 14:06:55 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:52 -0400
commit08853f18eafe65aa97deb464c28505a67c898b0e (patch)
tree2988f82253c797035756266c44c06104fdf312a9 /net/bluetooth/hci_event.c
parentc16900cf285ca240f0f84117bf8b88a03c55469b (diff)
Bluetooth: Set addr_type only when it's needed
In the hci_le_conn_complete_evt() function there's no need to set the addr_type value until it's actually needed, i.e. for the black list lookup. This patch moves the code a bit further down in the function. 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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3a99f30a3317..e8f35a90add5 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4193,16 +4193,16 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
4193 conn->dst_type = irk->addr_type; 4193 conn->dst_type = irk->addr_type;
4194 } 4194 }
4195 4195
4196 if (conn->dst_type == ADDR_LE_DEV_PUBLIC)
4197 addr_type = BDADDR_LE_PUBLIC;
4198 else
4199 addr_type = BDADDR_LE_RANDOM;
4200
4201 if (ev->status) { 4196 if (ev->status) {
4202 hci_le_conn_failed(conn, ev->status); 4197 hci_le_conn_failed(conn, ev->status);
4203 goto unlock; 4198 goto unlock;
4204 } 4199 }
4205 4200
4201 if (conn->dst_type == ADDR_LE_DEV_PUBLIC)
4202 addr_type = BDADDR_LE_PUBLIC;
4203 else
4204 addr_type = BDADDR_LE_RANDOM;
4205
4206 /* Drop the connection if the device is blocked */ 4206 /* Drop the connection if the device is blocked */
4207 if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) { 4207 if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) {
4208 hci_conn_drop(conn); 4208 hci_conn_drop(conn);