* Dereference all nodes to which this node points */
| 181 | * Dereference all nodes to which this node points |
| 182 | */ |
| 183 | static void |
| 184 | acl_free_node(struct acl_build_context *context, |
| 185 | struct rte_acl_node *node) |
| 186 | { |
| 187 | uint32_t n; |
| 188 | |
| 189 | if (node->prev != NULL) |
| 190 | node->prev->next = NULL; |
| 191 | for (n = 0; n < node->num_ptrs; n++) |
| 192 | acl_deref_ptr(context, node, n); |
| 193 | |
| 194 | /* free mrt if this is a match node */ |
| 195 | if (node->mrt != NULL) { |
| 196 | acl_build_free(context, sizeof(struct rte_acl_match_results), |
| 197 | node->mrt); |
| 198 | node->mrt = NULL; |
| 199 | } |
| 200 | |
| 201 | /* free transitions to other nodes */ |
| 202 | if (node->ptrs != NULL) { |
| 203 | acl_build_free(context, |
| 204 | node->max_ptrs * sizeof(struct rte_acl_ptr_set), |
| 205 | node->ptrs); |
| 206 | node->ptrs = NULL; |
| 207 | } |
| 208 | |
| 209 | /* put it on the free list */ |
| 210 | context->num_nodes--; |
| 211 | node->next = context->node_free_list; |
| 212 | context->node_free_list = node; |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /* |
no test coverage detected