Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291003
b: refs/heads/master
c: b5235a6
h: refs/heads/master
i:
  291001: 1dfbad5
  290999: 0816a98
v: v3
  • Loading branch information
Johan Hedberg committed Feb 21, 2012
1 parent b256245 commit d45275f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b34ee782164fbaf29b2e7c0e8cb3a898c0986ca
refs/heads/master: b5235a65ad19f47c5995f054d3dcce90570d1a1c
13 changes: 13 additions & 0 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,12 @@ static int set_dev_class(struct sock *sk, u16 index, void *data, u16 len)

hci_dev_lock(hdev);

if (!hdev_is_powered(hdev)) {
err = cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_NOT_POWERED);
goto unlock;
}

hdev->major_class = cp->major;
hdev->minor_class = cp->minor;

Expand All @@ -1288,6 +1294,7 @@ static int set_dev_class(struct sock *sk, u16 index, void *data, u16 len)
err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, 0,
NULL, 0);

unlock:
hci_dev_unlock(hdev);
hci_dev_put(hdev);

Expand Down Expand Up @@ -2076,6 +2083,12 @@ static int set_local_name(struct sock *sk, u16 index, void *data,

hci_dev_lock(hdev);

if (!hdev_is_powered(hdev)) {
err = cmd_status(sk, index, MGMT_OP_SET_LOCAL_NAME,
MGMT_STATUS_NOT_POWERED);
goto failed;
}

cmd = mgmt_pending_add(sk, MGMT_OP_SET_LOCAL_NAME, hdev, data,
len);
if (!cmd) {
Expand Down

0 comments on commit d45275f

Please sign in to comment.