On 4/7/20 4:43 AM, Kiran Kumar Kokkilagadda wrote: [...] >>> +static rte_edge_t >>> +edge_update(struct node *node, struct node *prev, rte_edge_t from, >>> + const char **next_nodes, rte_edge_t nb_edges) { >>> + rte_edge_t i, max_edges, count = 0; >>> + struct node *new_node; >>> + bool need_realloc; >>> + size_t sz; >>> + >>> + if (from == RTE_EDGE_ID_INVALID) >>> + from = node->nb_edges; >>> + >>> + /* Don't create hole in next_nodes[] list */ >>> + if (from > node->nb_edges) { >>> + rte_errno = ENOMEM; >>> + goto fail; >>> + } >>> + >>> + /* Remove me from list */ >>> + STAILQ_REMOVE(&node_list, node, node, next); > > This is where we will remove the node first unconditionally. Later we update > the new node.
Thanks Kiran, don't know how I missed that :) With regards Andrzej Ostruszka