aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-10-20 15:21:34 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-07 14:24:55 -0500
commit3c32fa93e5a54cd54e52541892857b0c7164a61e (patch)
tree304d6f5d0fcab11f40416c123a1f22a91fc8308e /net/bluetooth/hidp
parent25df0845e054f70a8735ee0184739472d8a573c9 (diff)
Bluetooth: Fix hidp_get_connection()
This functions needs crtl_sock and intr_sock to be set first. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp')
-rw-r--r--net/bluetooth/hidp/core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 56dc660d234a..3c2d888925d7 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -996,12 +996,6 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
996 return -ENOMEM; 996 return -ENOMEM;
997 } 997 }
998 998
999 session->conn = hidp_get_connection(session);
1000 if (!session->conn) {
1001 err = -ENOTCONN;
1002 goto failed;
1003 }
1004
1005 bacpy(&session->bdaddr, &bt_sk(ctrl_sock->sk)->dst); 999 bacpy(&session->bdaddr, &bt_sk(ctrl_sock->sk)->dst);
1006 1000
1007 session->ctrl_mtu = min_t(uint, l2cap_pi(ctrl_sock->sk)->chan->omtu, 1001 session->ctrl_mtu = min_t(uint, l2cap_pi(ctrl_sock->sk)->chan->omtu,
@@ -1015,6 +1009,12 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
1015 session->intr_sock = intr_sock; 1009 session->intr_sock = intr_sock;
1016 session->state = BT_CONNECTED; 1010 session->state = BT_CONNECTED;
1017 1011
1012 session->conn = hidp_get_connection(session);
1013 if (!session->conn) {
1014 err = -ENOTCONN;
1015 goto failed;
1016 }
1017
1018 setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session); 1018 setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session);
1019 1019
1020 skb_queue_head_init(&session->ctrl_transmit); 1020 skb_queue_head_init(&session->ctrl_transmit);