From b7b09dab5e9507541222d1d2ce86f55e9eb32b9e Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 29 Sep 2020 21:46:33 +0800 Subject: [PATCH] eventdev: fix adapter leak in error path In rte_event_crypto_adapter_create_ext() allocated memory for adapter, we should free it when error happens, otherwise it will lead to memory leak. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Jerin Jacob --- lib/librte_eventdev/rte_event_crypto_adapter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c index 8f25933163..b04312128a 100644 --- a/lib/librte_eventdev/rte_event_crypto_adapter.c +++ b/lib/librte_eventdev/rte_event_crypto_adapter.c @@ -241,6 +241,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, if (ret < 0) { RTE_EDEV_LOG_ERR("Failed to get info for eventdev %d: %s!", dev_id, dev_info.driver_name); + rte_free(adapter); return ret; } -- 2.20.1