aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-10-15 19:24:51 -0300
committerMoyster <oysterized@gmail.com>2019-07-18 20:58:43 +0200
commit09533de634cdd847ca5d87bf71f1345d861353bb (patch)
tree58dee33fe7142931dd0f7885f50b325634eac00a
parentb2da8f380c47f92dd95c26b330dbb04553751903 (diff)
Bluetooth: use l2cap_chan_ready() instead of duplicate code
In this case the replacement by l2cap_chan_ready() doesn't change the code flow, the same operations will executed plus two others that have no effect: the use of the parent socket, that a non-oriented channel doesn't have and the reset of conf_state, which is also fine since the connection is ready at this point. Change-Id: I96a54cf02cfefa546949f71d2f44ffaee1c2108c Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/l2cap_core.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d5830233d..642487a01 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1418,12 +1418,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
l2cap_chan_ready(chan);
} else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
- struct sock *sk = chan->sk;
- __clear_chan_timer(chan);
- lock_sock(sk);
- __l2cap_state_change(chan, BT_CONNECTED);
- sk->sk_state_change(sk);
- release_sock(sk);
+ l2cap_chan_ready(chan);
} else if (chan->state == BT_CONNECT)
l2cap_do_start(chan);