aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/netmap/netmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index b711e0d2497e..0bc723f6963d 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -2646,6 +2646,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data,
case NETMAP_REQ_PORT_INFO_GET: {
struct nmreq_port_info_get *req =
(struct nmreq_port_info_get *)(uintptr_t)hdr->nr_body;
+ int nmd_ref = 0;
NMG_LOCK();
do {
@@ -2687,6 +2688,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data,
error = EINVAL;
break;
}
+ nmd_ref = 1;
}
error = netmap_mem_get_info(nmd, &req->nr_memsize, &memflags,
@@ -2704,6 +2706,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data,
req->nr_host_rx_rings = na->num_host_rx_rings;
} while (0);
netmap_unget_na(na, ifp);
+ if (nmd_ref)
+ netmap_mem_put(nmd);
NMG_UNLOCK();
break;
}