aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-01-27 15:11:34 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 09:51:38 +0200
commitdfd9774c5ad4abe9d51e52056e441eaf983b9080 (patch)
tree5fde7fa03d6830b7e9d52fa40cceae0dd322edc0 /net/bluetooth/l2cap_core.c
parentBluetooth: Fix respecting le_default_mps value (diff)
downloadlinux-dev-dfd9774c5ad4abe9d51e52056e441eaf983b9080.tar.xz
linux-dev-dfd9774c5ad4abe9d51e52056e441eaf983b9080.zip
Bluetooth: Fix disconnecting L2CAP channel for credits violation
The L2CAP specification requires us to disconnect a channel if the remote device sends us data when it doesn't have any credits to do so. This patch makes sure that we send the appropriate L2CAP Disconnect request in this situation. 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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 5a30fc72f4ba..fbc9709abccf 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6635,6 +6635,7 @@ static int l2cap_le_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
if (!chan->rx_credits) {
BT_ERR("No credits to receive LE L2CAP data");
+ l2cap_send_disconn_req(chan, ECONNRESET);
return -ENOBUFS;
}