]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_mbuf/rte_mbuf.h
mbuf: fix NULL freeing when debug enabled
[dpdk.git] / lib / librte_mbuf / rte_mbuf.h
index 2fd4f5ef97c0809e050964d6d4398fd54a756788..ba3bfa8c6c89bd1e97dbb22e47795f73e5c85b9c 100644 (file)
@@ -1432,13 +1432,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;