DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] graph: fix node shrink
@ 2023-01-19 10:32 David Marchand
  2023-01-19 13:57 ` [EXT] " Kiran Kumar Kokkilagadda
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Marchand @ 2023-01-19 10:32 UTC (permalink / raw)
  To: dev
  Cc: stable, Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Pavan Nikhilesh

If the node id check failed, graph_lock was not taken before releasing.

Fixes: c59dac2ca14a ("graph: implement node operations")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-31 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 10:32 [PATCH] graph: fix node shrink David Marchand
2023-01-19 13:57 ` [EXT] " Kiran Kumar Kokkilagadda
2023-01-23 13:32 ` Jerin Jacob
2023-01-23 13:50   ` David Marchand
2023-01-23 13:53     ` Jerin Jacob
2023-01-31 10:13 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).