ethdev: rte_eth_dev_callback_unregister() fails with cb_arg == -1
Checks
Commit Message
The function was checking -1 against the callback data instead of
the given cb_arg parameter.
Signed-off-by: Ricardo Roldan <rroldan@bequant.com>
---
lib/librte_ethdev/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 1/7/2020 3:51 PM, Ricardo Roldan wrote:
> The function was checking -1 against the callback data instead of
> the given cb_arg parameter.
>
> Signed-off-by: Ricardo Roldan <rroldan@bequant.com>
Updated title as:
ethdev: fix callback unregister with wildcard argument list
Also adding following metadata to the commit log:
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
(This bug seems as old as DPDK itself J, thanks for fixing it.)
@@ -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;
/*