Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291033
b: refs/heads/master
c: 24c54a9
h: refs/heads/master
i:
  291031: 629dbdd
v: v3
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Feb 23, 2012
1 parent ca031b0 commit c88c39d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: f51d5b248981d05269e4f83ab8f8ed7ed494fe33
refs/heads/master: 24c54a90527ca5b85e7feedde2c779dc056ffddb
7 changes: 5 additions & 2 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,16 @@ static int set_discoverable(struct sock *sk, u16 index, void *data, u16 len)
return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE,
MGMT_STATUS_INVALID_PARAMS);

timeout = get_unaligned_le16(&cp->timeout);
if (!cp->val && timeout > 0)
return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE,
MGMT_STATUS_INVALID_PARAMS);

hdev = hci_dev_get(index);
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE,
MGMT_STATUS_INVALID_PARAMS);

timeout = get_unaligned_le16(&cp->timeout);

hci_dev_lock(hdev);

if (!hdev_is_powered(hdev) && timeout > 0) {
Expand Down

0 comments on commit c88c39d

Please sign in to comment.