From: Kamalakannan R <kamalakannan.r@intel.com>
To: dev@dpdk.org
Cc: harshad.suresh.narayane@intel.com, stable@dpdk.org,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH v3] pipeline: fix double free error for table stats
Date: Mon, 17 Apr 2023 16:52:43 +0530 [thread overview]
Message-ID: <20230417112243.727023-1-kamalakannan.r@intel.com> (raw)
The pointer to the table statistics data structure needs to be set
to NULL after free inside the table_build_free(), as this function is
called from multiple places, leading to double memory free error.
Similar fix for the learner_build_free() function.
Fixes: 742b0a57f50 ("pipeline: add table statistics to SWX")
Fixes: 4f59d372614 ("pipeline: support learner tables")
Cc: stable@dpdk.org
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/pipeline/rte_swx_pipeline.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index dea1378095..da37eda231 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -8665,6 +8665,7 @@ table_build_free(struct rte_swx_pipeline *p)
free(p->table_stats[i].n_pkts_action);
free(p->table_stats);
+ p->table_stats = NULL;
}
}
@@ -9579,6 +9580,7 @@ learner_build_free(struct rte_swx_pipeline *p)
free(p->learner_stats[i].n_pkts_action);
free(p->learner_stats);
+ p->learner_stats = NULL;
}
}
--
2.34.3
next reply other threads:[~2023-04-17 19:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 11:22 Kamalakannan R [this message]
2023-05-24 21:16 ` Thomas Monjalon
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=20230417112243.727023-1-kamalakannan.r@intel.com \
--to=kamalakannan.r@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=harshad.suresh.narayane@intel.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).