From 63f34e00646f9128903f0c45106c46416451eeac Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 7 Oct 2016 20:52:46 +0200 Subject: [PATCH] l2cap: log error if channel not found --- src/l2cap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/l2cap.c b/src/l2cap.c index 7a4bd03cd..84d8f4f0d 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1775,7 +1775,10 @@ static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t // find channel local_cid = little_endian_read_16(command, L2CAP_SIGNALING_COMMAND_DATA_OFFSET + 0); channel = l2cap_le_get_channel_for_local_cid(local_cid); - if (!channel) break; + if (!channel) { + log_error("l2cap: no channel for cid 0x%02x", local_cid); + break; + } channel->remote_sig_id = sig_id; channel->state = L2CAP_STATE_WILL_SEND_DISCONNECT_RESPONSE; break;