On Mon, Jan 23, 2023 at 7:21 PM David Marchand
<david.march...@redhat.com> wrote:
>
> On Mon, Jan 23, 2023 at 2:33 PM Jerin Jacob <jerinjac...@gmail.com> wrote:
> >
> > On Thu, Jan 19, 2023 at 4:02 PM David Marchand
> > <david.march...@redhat.com> wrote:
> > >
> > > If the node id check failed, graph_lock was not taken before releasing.
> >
> > Thanks for the fix.
> >
> >
> > Why not this oneline fix?
> >
> > [main][dpdk.org] $ git diff
> > diff --git a/lib/graph/node.c b/lib/graph/node.c
> > index fc6345de07..89cdcf0207 100644
> > --- a/lib/graph/node.c
> > +++ b/lib/graph/node.c
> > @@ -293,8 +293,8 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
> >         rte_edge_t rc = RTE_EDGE_ID_INVALID;
> >         struct node *node;
> >
> > -       NODE_ID_CHECK(id);
> >         graph_spinlock_lock();
> > +       NODE_ID_CHECK(id);
> >
> >         STAILQ_FOREACH(node, &node_list, next) {
> >                 if (node->id == id) {
>
> Other calls to NODE_ID_CHECK input check are done out of the lock.
> And to keep consistency with the rest of this library code.


Acked-by: Jerin Jacob <jer...@marvell.com>


>
> --
> David Marchand
>

Reply via email to