Commit d88b5bbf authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Remove unnecessary hdev locking in smp.c

Now that the SMP related key lists are converted to RCU there is nothing
in smp_cmd_sign_info() or smp_cmd_ident_addr_info() that would require
taking the hdev lock (including the smp_distribute_keys call). This
patch removes this unnecessary locking.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent adae20cb
...@@ -1374,8 +1374,6 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn, ...@@ -1374,8 +1374,6 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
skb_pull(skb, sizeof(*info)); skb_pull(skb, sizeof(*info));
hci_dev_lock(hcon->hdev);
/* Strictly speaking the Core Specification (4.1) allows sending /* Strictly speaking the Core Specification (4.1) allows sending
* an empty address which would force us to rely on just the IRK * an empty address which would force us to rely on just the IRK
* as "identity information". However, since such * as "identity information". However, since such
...@@ -1403,8 +1401,6 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn, ...@@ -1403,8 +1401,6 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
if (!(smp->remote_key_dist & KEY_DIST_MASK)) if (!(smp->remote_key_dist & KEY_DIST_MASK))
smp_distribute_keys(smp); smp_distribute_keys(smp);
hci_dev_unlock(hcon->hdev);
return 0; return 0;
} }
...@@ -1413,7 +1409,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -1413,7 +1409,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb)
struct smp_cmd_sign_info *rp = (void *) skb->data; struct smp_cmd_sign_info *rp = (void *) skb->data;
struct l2cap_chan *chan = conn->smp; struct l2cap_chan *chan = conn->smp;
struct smp_chan *smp = chan->data; struct smp_chan *smp = chan->data;
struct hci_dev *hdev = conn->hcon->hdev;
struct smp_csrk *csrk; struct smp_csrk *csrk;
BT_DBG("conn %p", conn); BT_DBG("conn %p", conn);
...@@ -1426,7 +1421,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -1426,7 +1421,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb)
skb_pull(skb, sizeof(*rp)); skb_pull(skb, sizeof(*rp));
hci_dev_lock(hdev);
csrk = kzalloc(sizeof(*csrk), GFP_KERNEL); csrk = kzalloc(sizeof(*csrk), GFP_KERNEL);
if (csrk) { if (csrk) {
csrk->master = 0x01; csrk->master = 0x01;
...@@ -1434,7 +1428,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -1434,7 +1428,6 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb)
} }
smp->csrk = csrk; smp->csrk = csrk;
smp_distribute_keys(smp); smp_distribute_keys(smp);
hci_dev_unlock(hdev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment