From: Yunjian Wang Date: Tue, 29 Sep 2020 13:46:33 +0000 (+0800) Subject: eventdev: fix adapter leak in error path X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b7b09dab5e9507541222d1d2ce86f55e9eb32b9e;p=dpdk.git 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 --- 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; }