From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com, arybchenko@solarflare.com
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>,
stable@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>
Subject: [dpdk-dev] [PATCH] net/enic: fix flow initialization error handling
Date: Thu, 8 Apr 2021 16:06:31 -0700 [thread overview]
Message-ID: <20210408230631.2648-1-johndale@cisco.com> (raw)
Fix a rare case in rte_flow initialization where the action hash table
is not freed if allocating a NIC match table fails.
Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
drivers/net/enic/enic_fm_flow.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index 21d9b1cef7..cd364ee16b 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -2890,7 +2890,7 @@ enic_fm_init(struct enic *enic)
rc = enic_fm_init_actions(fm);
if (rc) {
ENICPMD_LOG(ERR, "cannot create action hash, error:%d", rc);
- goto error_tables;
+ goto error_counters;
}
/*
* One default exact match table for each direction. We hold onto
@@ -2899,7 +2899,7 @@ enic_fm_init(struct enic *enic)
rc = enic_fet_alloc(fm, 1, NULL, 128, &fm->default_ig_fet);
if (rc) {
ENICPMD_LOG(ERR, "cannot alloc default IG exact match table");
- goto error_counters;
+ goto error_actions;
}
fm->default_ig_fet->ref = 1;
rc = enic_fet_alloc(fm, 0, NULL, 128, &fm->default_eg_fet);
@@ -2914,6 +2914,8 @@ enic_fm_init(struct enic *enic)
error_ig_fet:
enic_fet_free(fm, fm->default_ig_fet);
+error_actions:
+ rte_hash_free(fm->action_hash);
error_counters:
enic_fm_free_all_counters(fm);
error_tables:
--
2.26.2
next reply other threads:[~2021-04-08 23:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 23:06 John Daley [this message]
2021-04-09 8:57 ` Ferruh Yigit
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=20210408230631.2648-1-johndale@cisco.com \
--to=johndale@cisco.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=hyonkim@cisco.com \
--cc=stable@dpdk.org \
/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).