diff options
| author | Adrian Chadd <adrian@FreeBSD.org> | 2015-09-07 23:16:39 +0000 |
|---|---|---|
| committer | Adrian Chadd <adrian@FreeBSD.org> | 2015-09-07 23:16:39 +0000 |
| commit | 15b1492c9b09c465f5e13deb85292c0f2173c7fc (patch) | |
| tree | 65d41346c0e215d91f84621d49ee3f0c3f0bc4fc /sys/dev/netmap/netmap.c | |
| parent | c80b6ca937d436f3acc02784343964400fc7deff (diff) | |
Notes
Diffstat (limited to 'sys/dev/netmap/netmap.c')
| -rw-r--r-- | sys/dev/netmap/netmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 8094fe35256c6..56bbf120caffc 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -2841,10 +2841,12 @@ void netmap_detach(struct ifnet *ifp) { struct netmap_adapter *na = NA(ifp); + int skip; if (!na) return; + skip = 0; NMG_LOCK(); netmap_disable_all_rings(ifp); na->ifp = NULL; @@ -2856,10 +2858,11 @@ netmap_detach(struct ifnet *ifp) * the driver is gone. */ if (na->na_flags & NAF_NATIVE) { - netmap_adapter_put(na); + skip = netmap_adapter_put(na); } /* give them a chance to notice */ - netmap_enable_all_rings(ifp); + if (skip == 0) + netmap_enable_all_rings(ifp); NMG_UNLOCK(); } |
