[PATCH 2/2] examples/l2fwd-event: fix spinlock handling

Hemant Agrawal hemant.agrawal at nxp.com
Wed Nov 13 17:14:55 CET 2024


Detected by pvr-studio
Bug 89-93: very suspicious synchronization
The analyzer issued a pack of V1020 warnings that a resource
might remain blocked.

Fixes: 080f57bceca4 ("examples/l2fwd-event: add eventdev main loop")
Cc: pbhagavatula at marvell.com
Cc: stable at dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 examples/l2fwd-event/l2fwd_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c
index 22472027b9..416957384b 100644
--- a/examples/l2fwd-event/l2fwd_event.c
+++ b/examples/l2fwd-event/l2fwd_event.c
@@ -141,6 +141,7 @@ l2fwd_get_free_event_port(struct l2fwd_event_resources *evt_rsrc)
 	rte_spinlock_lock(&evt_rsrc->evp.lock);
 	if (index >= evt_rsrc->evp.nb_ports) {
 		printf("No free event port is available\n");
+		rte_spinlock_unlock(&evt_rsrc->evp.lock);
 		return -1;
 	}
 
-- 
2.25.1



More information about the stable mailing list