Commit c3f06755 authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo F. Padovan

Bluetooth: Fix deadlock with mgmt_pair_device

The hci_conn callbacks are called with the hci_dev lock already held so
no locking should be attempted in them.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 48264f06
...@@ -1331,19 +1331,14 @@ static void pairing_complete(struct pending_cmd *cmd, u8 status) ...@@ -1331,19 +1331,14 @@ static void pairing_complete(struct pending_cmd *cmd, u8 status)
static void pairing_complete_cb(struct hci_conn *conn, u8 status) static void pairing_complete_cb(struct hci_conn *conn, u8 status)
{ {
struct pending_cmd *cmd; struct pending_cmd *cmd;
struct hci_dev *hdev = conn->hdev;
BT_DBG("status %u", status); BT_DBG("status %u", status);
hci_dev_lock_bh(hdev);
cmd = find_pairing(conn); cmd = find_pairing(conn);
if (!cmd) if (!cmd)
BT_DBG("Unable to find a pending command"); BT_DBG("Unable to find a pending command");
else else
pairing_complete(cmd, status); pairing_complete(cmd, status);
hci_dev_unlock_bh(hdev);
} }
static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
......
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