[dpdk-stable] patch 'mbuf: fix NULL freeing when debug enabled' has been queued to LTS release 16.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Feb 7 17:46:34 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/09/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 59286a230c19a32fa945407625873b4cdb144099 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz at 6wind.com>
Date: Mon, 29 Jan 2018 10:39:23 +0100
Subject: [PATCH] mbuf: fix NULL freeing when debug enabled

[ upstream commit 9f8d9b2ee358c496fe206d1e6f111067afd501b3 ]

Do not panic when calling rte_pktmbuf_free(NULL) with mbuf debug
enabled, it is a valid operation.

Fixes: af75078fece3 ("first public release")

Reported-by: Keith Wiles <keith.wiles at intel.com>
Signed-off-by: Olivier Matz <olivier.matz at 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 2de97a370..bc015d033 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1233,13 +1233,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.14.2



More information about the stable mailing list