aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/smp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 976fce2315fd..a38941593e8b 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1076,6 +1076,8 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
1076 1076
1077 skb_pull(skb, sizeof(*info)); 1077 skb_pull(skb, sizeof(*info));
1078 1078
1079 hci_dev_lock(hcon->hdev);
1080
1079 /* Strictly speaking the Core Specification (4.1) allows sending 1081 /* Strictly speaking the Core Specification (4.1) allows sending
1080 * an empty address which would force us to rely on just the IRK 1082 * an empty address which would force us to rely on just the IRK
1081 * as "identity information". However, since such 1083 * as "identity information". However, since such
@@ -1085,8 +1087,7 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
1085 */ 1087 */
1086 if (!bacmp(&info->bdaddr, BDADDR_ANY)) { 1088 if (!bacmp(&info->bdaddr, BDADDR_ANY)) {
1087 BT_ERR("Ignoring IRK with no identity address"); 1089 BT_ERR("Ignoring IRK with no identity address");
1088 smp_distribute_keys(conn); 1090 goto distribute;
1089 return 0;
1090 } 1091 }
1091 1092
1092 bacpy(&smp->id_addr, &info->bdaddr); 1093 bacpy(&smp->id_addr, &info->bdaddr);
@@ -1100,8 +1101,11 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
1100 smp->remote_irk = hci_add_irk(conn->hcon->hdev, &smp->id_addr, 1101 smp->remote_irk = hci_add_irk(conn->hcon->hdev, &smp->id_addr,
1101 smp->id_addr_type, smp->irk, &rpa); 1102 smp->id_addr_type, smp->irk, &rpa);
1102 1103
1104distribute:
1103 smp_distribute_keys(conn); 1105 smp_distribute_keys(conn);
1104 1106
1107 hci_dev_unlock(hcon->hdev);
1108
1105 return 0; 1109 return 0;
1106} 1110}
1107 1111