From 7f6c636291d4ba43ad38b9db696cece298d6c284 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 30 Apr 2018 14:12:19 +0200 Subject: [PATCH] avrcp: fix log_error if avrcp context lookup fails --- src/classic/avrcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classic/avrcp.c b/src/classic/avrcp.c index d7ef79e32..4e1dbf624 100644 --- a/src/classic/avrcp.c +++ b/src/classic/avrcp.c @@ -619,8 +619,8 @@ void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet connection = get_avrcp_connection_for_bd_addr(event_addr, context); if (!connection){ - log_error("Failed to alloc AVRCP connection structure"); - avrcp_emit_connection_established(context->avrcp_callback, connection->avrcp_cid, event_addr, BTSTACK_MEMORY_ALLOC_FAILED); + // TODO: validate if this cannot happen. If not, drop disconnect call + log_error("AVRCP connection lookup failed"); l2cap_disconnect(local_cid, 0); // reason isn't used break; }