* [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path
@ 2020-09-29 13:46 wangyunjian
2020-10-05 16:16 ` Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: wangyunjian @ 2020-09-29 13:46 UTC (permalink / raw)
To: dev; +Cc: jerinj, jerry.lilijun, xudingke, Yunjian Wang, stable
From: Yunjian Wang <wangyunjian@huawei.com>
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 <wangyunjian@huawei.com>
---
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 8f2593316..b04312128 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.23.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path
2020-09-29 13:46 [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path wangyunjian
@ 2020-10-05 16:16 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-10-05 16:16 UTC (permalink / raw)
To: wangyunjian; +Cc: dpdk-dev, Jerin Jacob, Lilijun (Jerry), xudingke, dpdk stable
On Tue, Sep 29, 2020 at 7:17 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> 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 <wangyunjian@huawei.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-eventdev/for-main. Thanks.
> ---
> 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 8f2593316..b04312128 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.23.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-05 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 13:46 [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path wangyunjian
2020-10-05 16:16 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).