DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Weiguo Li <liwg06@foxmail.com>
Cc: dev <dev@dpdk.org>,
	adypodoman@gmail.com, Xiaoyun Li <xiaoyun.li@intel.com>,
	"Zhang, Tianfei" <tianfei.zhang@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	 Ivan Malov <ivan.malov@oktetlabs.ru>,
	Jakub Grajciar <jgrajcia@cisco.com>,
	 Harman Kalra <hkalra@marvell.com>,
	Ying A Wang <ying.a.wang@intel.com>,
	 "Xu, Ting" <ting.xu@intel.com>, simei <simei.su@intel.com>,
	 Qiming Yang <qiming.yang@intel.com>,
	motih@mellanox.com,  Shreyansh Jain <shreyansh.jain@nxp.com>,
	Satha Rao <skoteshwar@marvell.com>,
	 Stephen Hemminger <stephen@networkplumber.org>,
	 Kalesh A P <kalesh-anakkur.purayil@broadcom.com>,
	 Somnath Kotur <somnath.kotur@broadcom.com>,
	Declan Doherty <declan.doherty@intel.com>,
	 Akhil Goyal <gakhil@marvell.com>,
	Nicolas Chautru <nicolas.chautru@intel.com>
Subject: Re: [PATCH 03/20] crypto/dpaa2_sec: fix memory leaks in error handlings
Date: Fri, 24 Jun 2022 22:46:11 +0200	[thread overview]
Message-ID: <CAJFAV8wZ0r-dSbW5NZY+UG8cYC5og0oXtxP3ppgFBu=KSvQeYw@mail.gmail.com> (raw)
In-Reply-To: <tencent_301A1EB7D3F9082E1DAC6F9B111091899807@qq.com>

On Tue, Feb 22, 2022 at 7:19 PM Weiguo Li <liwg06@foxmail.com> wrote:
>
> When function returned from error handling branches, the memories were
> not freed which caused a memory leak.
>
> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

This is backport material.
Please add Cc: stable@dpdk.org in new revision.

>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index e62d04852b..3f8d4d213f 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> @@ -2037,12 +2037,15 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
>                 RTE_CACHE_LINE_SIZE);
>         if (!qp->rx_vq.q_storage) {
>                 DPAA2_SEC_ERR("malloc failed for q_storage");
> +               rte_free(qp);
>                 return -ENOMEM;
>         }
>         memset(qp->rx_vq.q_storage, 0, sizeof(struct queue_storage_info_t));
>
>         if (dpaa2_alloc_dq_storage(qp->rx_vq.q_storage)) {
>                 DPAA2_SEC_ERR("Unable to allocate dequeue storage");
> +               rte_free(qp->rx_vq.q_storage);
> +               rte_free(qp);
>                 return -ENOMEM;
>         }


Please rebase this fix, there was a new allocation introduced in this
code and I suspect this should be fixed too.
Thanks.


-- 
David Marchand


  reply	other threads:[~2022-06-24 20:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1645551559.git.liwg06@foxmail.com>
2022-02-22 18:17 ` [PATCH 01/20] baseband/acc100: fix a memory leak in acc100 queue setup Weiguo Li
2022-02-23 17:42   ` Chautru, Nicolas
2022-06-24 20:45   ` David Marchand
2022-02-22 18:18 ` [PATCH 02/20] common/dpaax: fix a memory leak in iterate dir Weiguo Li
2022-02-22 18:18 ` [PATCH 03/20] crypto/dpaa2_sec: fix memory leaks in error handlings Weiguo Li
2022-06-24 20:46   ` David Marchand [this message]
2022-02-22 18:18 ` [PATCH 04/20] crypto/qat: fix a memory leak when set encrypt key fail Weiguo Li
2022-06-24 20:49   ` David Marchand
2022-02-22 18:18 ` [PATCH 05/20] net/bnxt: fix a memory leak in error handling Weiguo Li
2022-02-22 18:18 ` [PATCH 06/20] net/bnxt: fix 'ctx' memory leak when new malloc fail Weiguo Li
2022-02-22 18:18 ` [PATCH 07/20] net/bnx2x: add clean up for 'rxq' to avoid a memory leak Weiguo Li
2022-02-22 18:18 ` [PATCH 08/20] net/cnxk: free 'node' memory when node add fail Weiguo Li
2022-04-07  9:02   ` Nithin Kumar Dabilpuram
2022-02-22 18:18 ` [PATCH 09/20] net/dpaa: fix a memory leak when validation fail Weiguo Li
2022-02-22 18:18 ` [PATCH 10/20] net/failsafe: fix a memory leak in error handling Weiguo Li
2022-02-22 18:18 ` [PATCH 11/20] net/iavf: " Weiguo Li
2022-02-22 18:18 ` [PATCH 12/20] net/ice: goto clean up lable to avoid memory leak Weiguo Li
2022-02-22 18:18 ` [PATCH 13/20] net/ice: fix memory leaks in error handlings Weiguo Li
2022-06-02  8:04   ` David Marchand
2022-02-22 18:18 ` [PATCH 14/20] net/ice: avoid fix memory leaks in register parser Weiguo Li
2022-02-22 18:18 ` [PATCH 15/20] net/memif: fix some memory leaks in error handlings Weiguo Li
2022-02-22 18:18 ` [PATCH 16/20] net/sfc: fix a memory leak in error handling Weiguo Li
2022-03-03  7:39   ` Andrew Rybchenko
2022-02-22 18:18 ` [PATCH 17/20] net/vmxnet3: fix memory leaks in error handlings Weiguo Li
2022-02-22 18:18 ` [PATCH 18/20] raw/ifpga/base: " Weiguo Li
2022-02-22 18:28 ` [PATCH 19/20] raw/ntb: fix some " Weiguo Li
2022-02-22 18:28 ` [PATCH 20/20] regex/mlx5: fix a memory leak in error handling Weiguo Li

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='CAJFAV8wZ0r-dSbW5NZY+UG8cYC5og0oXtxP3ppgFBu=KSvQeYw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=adypodoman@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hkalra@marvell.com \
    --cc=ivan.malov@oktetlabs.ru \
    --cc=jgrajcia@cisco.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=liwg06@foxmail.com \
    --cc=motih@mellanox.com \
    --cc=nicolas.chautru@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=simei.su@intel.com \
    --cc=skoteshwar@marvell.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stephen@networkplumber.org \
    --cc=tianfei.zhang@intel.com \
    --cc=ting.xu@intel.com \
    --cc=xiaoyun.li@intel.com \
    --cc=ying.a.wang@intel.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).