diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2024-08-02 13:09:41 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2024-08-20 13:27:05 +0000 |
| commit | 7178003234932e62dd552da9b39d2e6c35ed97f8 (patch) | |
| tree | 10dd4e96db30d473005e8b4f7b87ba64316251fc /sys/dev/xen | |
| parent | 63398f340041fe630e56f9daccd62920adc85796 (diff) | |
Diffstat (limited to 'sys/dev/xen')
| -rw-r--r-- | sys/dev/xen/netfront/netfront.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index dafb838cf328..da0f1680a87e 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -335,8 +335,16 @@ static void mbuf_release(struct mbuf *m) KASSERT(ref != NULL, ("Cannot find refcount")); KASSERT(ref->count > 0, ("Invalid reference count")); - if (--ref->count == 0) + if (--ref->count == 0) { + /* + * Explicitly free the tag while we hold the tx queue lock. + * This ensures that the tag is deleted promptly in case + * something else is holding extra references to the mbuf chain, + * such as netmap. + */ + m_tag_delete(m, &ref->tag); m_freem(m); + } } static void tag_free(struct m_tag *t) |
