* [dpdk-stable] [PATCH v3] mbuf: fix freeing of NULL mbuf when debug enabled
[not found] <20180109142928.81687-1-keith.wiles@intel.com>
@ 2018-01-29 9:39 ` Olivier Matz
2018-01-29 15:58 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2018-01-29 9:39 UTC (permalink / raw)
To: dev; +Cc: Keith Wiles, stephen, jerin.jacob, stable
Do not panic when calling rte_pktmbuf_free(NULL) with mbuf debug
enabled, it is a valid operation.
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mbuf/rte_mbuf.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 4519fb303..719d04dda 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1439,13 +1439,14 @@ rte_pktmbuf_free_seg(struct rte_mbuf *m)
* segment is added back into its original mempool.
*
* @param m
- * The packet mbuf to be freed.
+ * The packet mbuf to be freed. If NULL, the function does nothing.
*/
static inline void rte_pktmbuf_free(struct rte_mbuf *m)
{
struct rte_mbuf *m_next;
- __rte_mbuf_sanity_check(m, 1);
+ if (m != NULL)
+ __rte_mbuf_sanity_check(m, 1);
while (m != NULL) {
m_next = m->next;
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v3] mbuf: fix freeing of NULL mbuf when debug enabled
2018-01-29 9:39 ` [dpdk-stable] [PATCH v3] mbuf: fix freeing of NULL mbuf when debug enabled Olivier Matz
@ 2018-01-29 15:58 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2018-01-29 15:58 UTC (permalink / raw)
To: Olivier Matz; +Cc: dev, Keith Wiles, stephen, jerin.jacob, stable
29/01/2018 10:39, Olivier Matz:
> Do not panic when calling rte_pktmbuf_free(NULL) with mbuf debug
> enabled, it is a valid operation.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Reported-by: Keith Wiles <keith.wiles@intel.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Applied, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-29 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20180109142928.81687-1-keith.wiles@intel.com>
2018-01-29 9:39 ` [dpdk-stable] [PATCH v3] mbuf: fix freeing of NULL mbuf when debug enabled Olivier Matz
2018-01-29 15:58 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
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).