Skip to contentSkip to conversation

ethdev: rte_eth_dev_callback_unregister() fails with cb_arg == -1

PATCH Applied Ricardo Roldan 2 participants 2 messages Jan 7, 2020 – Jan 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: rte_eth_dev_callback_unregister() fails with cb_arg == -1

The function was checking -1 against the callback data instead of the given cb_arg parameter.

---
 lib/librte_ethdev/rte_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_ethdev/rte_ethdev.c +1 -1
index 6e9cb243e..aec2d0f70 100644
@@ -4039,7 +4039,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id,
 			next = TAILQ_NEXT(cb, next);
 
 			if (cb->cb_fn != cb_fn || cb->event != event ||
-			    (cb->cb_arg != (void *)-1 && cb->cb_arg != cb_arg))
+			    (cb_arg != (void *)-1 && cb->cb_arg != cb_arg))
 				continue;
 
 			/*
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 4 lines · Ricardo Roldan

The function was checking -1 against the callback data instead of the given cb_arg parameter.

Updated title as:
ethdev: fix callback unregister with wildcard argument list

Also adding following metadata to the commit log:

Fixes af75078fece3 ("first public release")

Applied to dpdk-next-net/master, thanks.

(This bug seems as old as DPDK itself J, thanks for fixing it.)