[dpdk-dev] [PATCH] ethdev: avoid unregistering a non-allocated callback
Thomas Monjalon
thomas at monjalon.net
Tue Jul 13 15:17:13 CEST 2021
When registering a new event callback, if allocation fails,
there is no need for unregistering the callback,
because it is not registered.
Fixes: 9ec0b3869d8d ("ethdev: allow event registration for all ports")
Cc: stable at dpdk.org
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
lib/ethdev/rte_ethdev.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9d95cd11e1..1731854628 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4649,8 +4649,6 @@ rte_eth_dev_callback_register(uint16_t port_id,
user_cb, next);
} else {
rte_spinlock_unlock(ð_dev_cb_lock);
- rte_eth_dev_callback_unregister(port_id, event,
- cb_fn, cb_arg);
return -ENOMEM;
}
--
2.31.1
More information about the dev
mailing list