git: 95fc11577d11 - main - netmap: monitor: add missing netmap_adapter_put()

From: Vincenzo Maffione <vmaffione_at_FreeBSD.org>
Date: Sat, 24 Dec 2022 16:08:12 UTC
The branch main has been updated by vmaffione:

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

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

    netmap: monitor: add missing netmap_adapter_put()
    
    MFC after:      7 days
---
 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 9f94bed056a1..8e3e39e6aadd 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);
 				}
 				/* orphan the zmon list */
 				if (z->next != NULL)