summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2013-09-16 12:05:15 +0200
committerGustavo Padovan2013-09-18 23:44:32 +0200
commitc4ea249f5f164957ec8402ba9f3b827d740b299c (patch)
tree0d9779bbe92424d72d115c81893c780a69d34e4c /net/bluetooth/l2cap_core.c
parentBluetooth: Fix L2CAP error return used for failed channel lookups (diff)
downloadkernel-qcow2-linux-c4ea249f5f164957ec8402ba9f3b827d740b299c.tar.gz
kernel-qcow2-linux-c4ea249f5f164957ec8402ba9f3b827d740b299c.tar.xz
kernel-qcow2-linux-c4ea249f5f164957ec8402ba9f3b827d740b299c.zip
Bluetooth: Fix L2CAP Disconnect response for unknown CID
If we receive an L2CAP Disconnect Request for an unknown CID we should not just silently drop it but reply with a proper Command Reject response. This patch fixes this by ensuring that the disconnect handler returns a proper error instead of 0 and will cause the function caller to send the right response. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index eb60cf78af77..31bf81275990 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4206,7 +4206,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn,
chan = __l2cap_get_chan_by_scid(conn, dcid);
if (!chan) {
mutex_unlock(&conn->chan_lock);
- return 0;
+ return -EBADSLT;
}
l2cap_chan_lock(chan);