git: cce75f3327b8 - stable/13 - netmap: monitor: add missing netmap_adapter_put()

From: Vincenzo Maffione <vmaffione_at_FreeBSD.org>
Date: Sat, 31 Dec 2022 12:07:08 UTC
The branch stable/13 has been updated by vmaffione:

URL: https://cgit.FreeBSD.org/src/commit/?id=cce75f3327b89dd544bdc1e81080dd344e526947

commit cce75f3327b89dd544bdc1e81080dd344e526947
Author:     Vincenzo Maffione <vmaffione@FreeBSD.org>
AuthorDate: 2022-12-24 16:03:14 +0000
Commit:     Vincenzo Maffione <vmaffione@FreeBSD.org>
CommitDate: 2022-12-31 12:06:04 +0000

    netmap: monitor: add missing netmap_adapter_put()
    
    MFC after:      7 days
    
    (cherry picked from commit 95fc11577d117327e7d99a589e86ba15d0599654)
---
 sys/dev/netmap/netmap_monitor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c
index 6294cc9bdbba..967288c3bb29 100644
--- a/sys/dev/netmap/netmap_monitor.c
+++ b/sys/dev/netmap/netmap_monitor.c
@@ -487,6 +487,8 @@ netmap_monitor_stop(struct netmap_adapter *na)
 					/* let the monitor forget about us */
 					netmap_adapter_put(next->priv.np_na); /* nop if null */
 					next->priv.np_na = NULL;
+					/* drop the additional ref taken in netmap_monitor_add() */
+					netmap_adapter_put(zkring->zmon_list[t].prev->na);
 				}
 				/* orhpan the zmon list */
 				if (z->next != NULL)