mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-18 23:18:20 +00:00
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>
This commit is contained in:
parent
25df0845e0
commit
3c32fa93e5
@ -996,12 +996,6 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
session->conn = hidp_get_connection(session);
|
|
||||||
if (!session->conn) {
|
|
||||||
err = -ENOTCONN;
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
|
|
||||||
bacpy(&session->bdaddr, &bt_sk(ctrl_sock->sk)->dst);
|
bacpy(&session->bdaddr, &bt_sk(ctrl_sock->sk)->dst);
|
||||||
|
|
||||||
session->ctrl_mtu = min_t(uint, l2cap_pi(ctrl_sock->sk)->chan->omtu,
|
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,
|
|||||||
session->intr_sock = intr_sock;
|
session->intr_sock = intr_sock;
|
||||||
session->state = BT_CONNECTED;
|
session->state = BT_CONNECTED;
|
||||||
|
|
||||||
|
session->conn = hidp_get_connection(session);
|
||||||
|
if (!session->conn) {
|
||||||
|
err = -ENOTCONN;
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session);
|
setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session);
|
||||||
|
|
||||||
skb_queue_head_init(&session->ctrl_transmit);
|
skb_queue_head_init(&session->ctrl_transmit);
|
||||||
|
Loading…
Reference in New Issue
Block a user