patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: wangyunjian <wangyunjian@huawei.com>
Cc: dpdk-dev <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	 "Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	xudingke <xudingke@huawei.com>,  dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path
Date: Mon, 5 Oct 2020 21:46:24 +0530	[thread overview]
Message-ID: <CALBAE1PKBAj9TkotYgOd+RmeJ+NOsHUYfxZnTyN9PwPBRADtNQ@mail.gmail.com> (raw)
In-Reply-To: <b511454f0252d3c0d18e15ec587312ba7400fdb6.1601368991.git.wangyunjian@huawei.com>

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
>

      reply	other threads:[~2020-10-05 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 13:46 wangyunjian
2020-10-05 16:16 ` Jerin Jacob [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBAE1PKBAj9TkotYgOd+RmeJ+NOsHUYfxZnTyN9PwPBRADtNQ@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).