DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Owen Hilyard <ohilyard@iol.unh.edu>,
	 "Iremonger, Bernard" <bernard.iremonger@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] lib/flow_classify: fix leaking rules on delete
Date: Tue, 22 Jun 2021 09:24:14 +0200
Message-ID: <CAJFAV8wpct2G_ZHWgnirA9x40AUGSCkAs9+WcBsq9cFWutbVcw@mail.gmail.com> (raw)
In-Reply-To: <20210616195724.366103-1-ohilyard@iol.unh.edu>

On Wed, Jun 16, 2021 at 9:57 PM <ohilyard@iol.unh.edu> wrote:
>
> From: Owen Hilyard <ohilyard@iol.unh.edu>
>
> Rules in a classify table were not freed if the table
> had a delete function.
>
> Fixes: be41ac2a3 ("flow_classify: introduce flow classify library")
Cc: stable@dpdk.org

>
> Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
> ---
>  lib/flow_classify/rte_flow_classify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/flow_classify/rte_flow_classify.c b/lib/flow_classify/rte_flow_classify.c
> index f125267e8..06aed3b70 100644
> --- a/lib/flow_classify/rte_flow_classify.c
> +++ b/lib/flow_classify/rte_flow_classify.c
> @@ -579,7 +579,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
>                                                 &rule->u.key.key_del,
>                                                 &rule->key_found,
>                                                 &rule->entry);
> -
> +                               free(rule);
>                                 return ret;
>                         }
>                 }

I find it strange to free the rule regardless of the result of the
f_delete() op.
The same is done out of the loop which means this function returns
-EINVAL and frees the rule in this case too.

Bernard, Ferruh, can you review please?

Thanks!


-- 
David Marchand


  reply	other threads:[~2021-06-22  7:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 19:57 ohilyard
2021-06-22  7:24 ` David Marchand [this message]
2021-06-22 11:59   ` Iremonger, Bernard
2021-06-23 17:07 ` [dpdk-dev] [PATCH v2] flow_classify: " ohilyard
2021-06-24  8:43   ` Iremonger, Bernard
2021-06-24  9:12     ` David Marchand
2021-06-24 13:21   ` David Marchand

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=CAJFAV8wpct2G_ZHWgnirA9x40AUGSCkAs9+WcBsq9cFWutbVcw@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ohilyard@iol.unh.edu \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git