Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291080
b: refs/heads/master
c: 1de028c
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Mar 1, 2012
1 parent 59f1944 commit 0e7c670
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 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: 00abfe4442864144a77f70b6b411d691bcb796bf
refs/heads/master: 1de028ceb54ccd28cc96f1530a195ae1b6a6d5b5
17 changes: 10 additions & 7 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,12 @@ static int set_le(struct sock *sk, u16 index, void *data, u16 len)
return cmd_status(sk, index, MGMT_OP_SET_LE,
MGMT_STATUS_INVALID_PARAMS);

hci_dev_lock(hdev);

if (!enable_le || !(hdev->features[4] & LMP_LE)) {
err = cmd_status(sk, index, MGMT_OP_SET_LE,
MGMT_STATUS_NOT_SUPPORTED);
goto failed;
goto unlock;
}

val = !!cp->val;
Expand All @@ -1292,23 +1294,23 @@ static int set_le(struct sock *sk, u16 index, void *data, u16 len)

err = send_settings_rsp(sk, MGMT_OP_SET_LE, hdev);
if (err < 0)
goto failed;
goto unlock;

if (changed)
err = new_settings(hdev, sk);

goto failed;
goto unlock;
}

if (mgmt_pending_find(MGMT_OP_SET_LE, hdev)) {
err = cmd_status(sk, index, MGMT_OP_SET_LE, MGMT_STATUS_BUSY);
goto failed;
goto unlock;
}

cmd = mgmt_pending_add(sk, MGMT_OP_SET_LE, hdev, data, len);
if (!cmd) {
err = -ENOMEM;
goto failed;
goto unlock;
}

memset(&hci_cp, 0, sizeof(hci_cp));
Expand All @@ -1322,10 +1324,11 @@ static int set_le(struct sock *sk, u16 index, void *data, u16 len)
sizeof(hci_cp), &hci_cp);
if (err < 0) {
mgmt_pending_remove(cmd);
goto failed;
goto unlock;
}

failed:
unlock:
hci_dev_unlock(hdev);
hci_dev_put(hdev);
return err;
}
Expand Down

0 comments on commit 0e7c670

Please sign in to comment.