aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-07 22:56:43 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 08:49:12 +0200
commit5ff6f34d4260c542df3712e29ead87cf071ad472 (patch)
treeb6303499e02983ffc3df65740d31c3d6f5a9307b /net/bluetooth/l2cap_core.c
parentBluetooth: Fix reference counting of global L2CAP channels (diff)
downloadlinux-dev-5ff6f34d4260c542df3712e29ead87cf071ad472.tar.xz
linux-dev-5ff6f34d4260c542df3712e29ead87cf071ad472.zip
Bluetooth: Fix __l2cap_no_conn_pending() usage with all channels
The __l2cap_no_conn_pending() function would previously only return a meaningful value for connection oriented channels and was therefore not useful for anything else. As preparation of making the L2CAP code more generic allow the function to be called for other channel types as well by returning a meaningful value for them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index a47a14efd5aa..a0a910eb897b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1082,6 +1082,9 @@ static void l2cap_send_rr_or_rnr(struct l2cap_chan *chan, bool poll)
static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan)
{
+ if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED)
+ return true;
+
return !test_bit(CONF_CONNECT_PEND, &chan->conf_state);
}