[EXT] [PATCH] graph: fix node shrink

Kiran Kumar Kokkilagadda kirankumark at marvell.com
Thu Jan 19 14:57:52 CET 2023



> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: 19 January 2023 04:03 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Kiran
> Kumar Kokkilagadda <kirankumark at marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram at marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula at marvell.com>
> Subject: [EXT] [PATCH] graph: fix node shrink
> 
> External Email
> 
> ----------------------------------------------------------------------
> If the node id check failed, graph_lock was not taken before releasing.
> 
> Fixes: c59dac2ca14a ("graph: implement node operations")
> Cc: stable at dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>

Acked-by: Kiran Kumar Kokkilagadda <kirankumark at marvell.com>

> ---
>  lib/graph/node.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/graph/node.c b/lib/graph/node.c index fc6345de07..149414dcd9
> 100644
> --- a/lib/graph/node.c
> +++ b/lib/graph/node.c
> @@ -300,16 +300,16 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t
> size)
>  		if (node->id == id) {
>  			if (node->nb_edges < size) {
>  				rte_errno = E2BIG;
> -				goto fail;
> +			} else {
> +				node->nb_edges = size;
> +				rc = size;
>  			}
> -			node->nb_edges = size;
> -			rc = size;
>  			break;
>  		}
>  	}
> 
> -fail:
>  	graph_spinlock_unlock();
> +fail:
>  	return rc;
>  }
> 
> --
> 2.39.0



More information about the stable mailing list