Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278568
b: refs/heads/master
c: 1425acb
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Nov 16, 2011
1 parent be46ed0 commit fbd52f7
Show file tree
Hide file tree
Showing 2 changed files with 12 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: ba4e564f60064689661882c84fa2ee63e39b457e
refs/heads/master: 1425acb74b6d58690d78027021ce1d8f3068c66f
13 changes: 11 additions & 2 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
{
struct hci_dev *hdev;
struct mgmt_cp_pair_device *cp;
struct mgmt_rp_pair_device rp;
struct pending_cmd *cmd;
u8 sec_level, auth_type;
struct hci_conn *conn;
Expand Down Expand Up @@ -1397,14 +1398,22 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
conn = hci_connect(hdev, LE_LINK, &cp->addr.bdaddr, sec_level,
auth_type);

memset(&rp, 0, sizeof(rp));
bacpy(&rp.addr.bdaddr, &cp->addr.bdaddr);
rp.addr.type = cp->addr.type;

if (IS_ERR(conn)) {
err = PTR_ERR(conn);
rp.status = -PTR_ERR(conn);
err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE,
&rp, sizeof(rp));
goto unlock;
}

if (conn->connect_cfm_cb) {
hci_conn_put(conn);
err = cmd_status(sk, index, MGMT_OP_PAIR_DEVICE, EBUSY);
rp.status = EBUSY;
err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE,
&rp, sizeof(rp));
goto unlock;
}

Expand Down

0 comments on commit fbd52f7

Please sign in to comment.