Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291084
b: refs/heads/master
c: 6a91908
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg committed Mar 1, 2012
1 parent fd39dfe commit c368819
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdb6d97154b7b7e98867e9b71bae0f47ec70b1d7
refs/heads/master: 6a919082e9b82a0de20f1248a33f3b3f005cebaf
10 changes: 6 additions & 4 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,11 @@ static void service_cache_off(struct work_struct *work)
hci_dev_unlock(hdev);
}

static void mgmt_init_hdev(struct hci_dev *hdev)
static void mgmt_init_hdev(struct sock *sk, struct hci_dev *hdev)
{
if (!test_and_clear_bit(HCI_PI_MGMT_INIT, &hci_pi(sk)->flags))
return;

if (!test_and_set_bit(HCI_MGMT, &hdev->dev_flags)) {
INIT_DELAYED_WORK(&hdev->service_cache, service_cache_off);

Expand All @@ -632,9 +635,6 @@ static int read_controller_info(struct sock *sk, struct hci_dev *hdev)

hci_dev_lock(hdev);

if (test_and_clear_bit(HCI_PI_MGMT_INIT, &hci_pi(sk)->flags))
mgmt_init_hdev(hdev);

memset(&rp, 0, sizeof(rp));

bacpy(&rp.bdaddr, &hdev->bdaddr);
Expand Down Expand Up @@ -2764,6 +2764,8 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
MGMT_STATUS_INVALID_PARAMS);
goto done;
}

mgmt_init_hdev(sk, hdev);
}

cp = buf + sizeof(*hdr);
Expand Down

0 comments on commit c368819

Please sign in to comment.