From: Johan Hedberg Date: Mon, 27 Jan 2014 23:11:34 +0000 (-0800) Subject: Bluetooth: Fix disconnecting L2CAP channel for credits violation X-Git-Tag: v5.15~17544^2~11^2~7^2~45^2~267 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfd9774c5ad4abe9d51e52056e441eaf983b9080;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 5a30fc7..fbc9709 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; }