Skip to content

Commit

Permalink
Bluetooth: Fix deadlock with mgmt_pair_device
Browse files Browse the repository at this point in the history
The hci_conn callbacks are called with the hci_dev lock already held so
no locking should be attempted in them.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Nov 10, 2011
1 parent 48264f0 commit c3f0675
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct pending_cmd *cmd;
struct hci_dev *hdev = conn->hdev;

BT_DBG("status %u", status);

hci_dev_lock_bh(hdev);

cmd = find_pairing(conn);
if (!cmd)
BT_DBG("Unable to find a pending command");
else
pairing_complete(cmd, status);

hci_dev_unlock_bh(hdev);
}

static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
Expand Down

0 comments on commit c3f0675

Please sign in to comment.