Update README.md for supported kernel
[lttng-modules.git] / lttng-filter-validator.c
index 051db49c87e5f75d7ea5c525ce76fcba90ddef7a..c9094547fa47bef52d0b00e53b609f635d4b87b5 100644 (file)
@@ -1,34 +1,16 @@
-/*
+/* SPDX-License-Identifier: MIT
+ *
  * lttng-filter-validator.c
  *
  * LTTng modules filter bytecode validator.
  *
  * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 #include <linux/types.h>
 #include <linux/jhash.h>
 #include <linux/slab.h>
 
-#include <wrapper/list.h>
 #include <lttng-filter.h>
 
 #define MERGE_POINT_TABLE_BITS         7
@@ -92,7 +74,7 @@ int merge_point_add_check(struct mp_table *mp_table, unsigned long target_pc,
        memcpy(&mp_node->stack, stack, sizeof(mp_node->stack));
 
        head = &mp_table->mp_head[hash & (MERGE_POINT_TABLE_SIZE - 1)];
-       lttng_hlist_for_each_entry(lookup_node, head, node) {
+       hlist_for_each_entry(lookup_node, head, node) {
                if (lttng_hash_match(lookup_node, target_pc)) {
                        found = 1;
                        break;
@@ -514,6 +496,7 @@ int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
                if (unlikely(pc + sizeof(struct load_op) + sizeof(struct get_symbol)
                                > start_pc + bytecode->len)) {
                        ret = -ERANGE;
+                       break;
                }
                ret = validate_get_symbol(bytecode, sym);
                break;
@@ -554,7 +537,7 @@ unsigned long delete_all_nodes(struct mp_table *mp_table)
                struct hlist_head *head;
 
                head = &mp_table->mp_head[i];
-               lttng_hlist_for_each_entry_safe(mp_node, tmp, head, node) {
+               hlist_for_each_entry_safe(mp_node, tmp, head, node) {
                        kfree(mp_node);
                        nr_nodes++;
                }
@@ -1115,7 +1098,7 @@ int validate_instruction_all_contexts(struct bytecode_runtime *bytecode,
        /* Validate merge points */
        hash = jhash_1word(target_pc, 0);
        head = &mp_table->mp_head[hash & (MERGE_POINT_TABLE_SIZE - 1)];
-       lttng_hlist_for_each_entry(mp_node, head, node) {
+       hlist_for_each_entry(mp_node, head, node) {
                if (lttng_hash_match(mp_node, target_pc)) {
                        found = 1;
                        break;
This page took 0.024359 seconds and 4 git commands to generate.