This checks if connection with provided ID actually belongs to the client or server apps. Previously server_disconnect could be called with clients connection ID and vice versa. --- android/gatt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 9c2f3ba..9607416 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -1587,7 +1587,7 @@ static void handle_client_disconnect(const void *buf, uint16_t len) /* TODO: should we care to match also bdaddr when conn_id is unique? */ conn = find_connection_by_id(cmd->conn_id); - if (conn) + if (conn && conn->app->type == APP_CLIENT) trigger_disconnection(conn); status = HAL_STATUS_SUCCESS; @@ -3725,7 +3725,7 @@ static void handle_server_disconnect(const void *buf, uint16_t len) /* TODO: should we care to match also bdaddr when conn_id is unique? */ conn = find_connection_by_id(cmd->conn_id); - if (conn) + if (conn && conn->app->type == APP_SERVER) trigger_disconnection(conn); status = HAL_STATUS_SUCCESS; -- 2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html