summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-22 08:27:42 -0300
committerRenato Botelho <renato@netgate.com>2016-03-22 08:31:11 -0300
commit745e97fea4169ce4a217dbb4a1c46055a2ccc468 (patch)
treef2ed4e299b2cd9209f9283e16e3167dc7ab35d40 /sys/dev
parent7ad21b623013ad341bedcb7c1f59d0a0a7eec503 (diff)
downloadFreeBSD-src-745e97fea4169ce4a217dbb4a1c46055a2ccc468.zip
FreeBSD-src-745e97fea4169ce4a217dbb4a1c46055a2ccc468.tar.gz
Backport patch from D5698
This is an attempt to fix Chelsio cxl driver mbuf leak https://reviews.freebsd.org/D5698 (cherry picked from commit c35924db4e1edd83f5a845760098fc8cbd7f7456)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/netmap/netmap_generic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c
index ecdb368..4983516 100644
--- a/sys/dev/netmap/netmap_generic.c
+++ b/sys/dev/netmap/netmap_generic.c
@@ -129,8 +129,9 @@ static inline struct mbuf *
netmap_get_mbuf(int len)
{
struct mbuf *m;
- m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE);
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
if (m) {
+ m->m_flags |= M_NOFREE; /* XXXNP: Almost certainly incorrect. */
m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save
m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor;
m->m_ext.ext_type = EXT_EXTREF;
OpenPOWER on IntegriCloud