Skip to content

Commit 9364f59

Browse files
vale: detach before possibly destroying ifp
1 parent e14bf34 commit 9364f59

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sys/dev/netmap/netmap_vale.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ nm_vi_destroy(const char *name)
565565
goto err;
566566
}
567567

568+
D("refcount %d", NA(ifp)->na_refcount);
568569
if (NA(ifp)->na_refcount > 1) {
569570
error = EBUSY;
570571
goto err;
@@ -575,8 +576,8 @@ nm_vi_destroy(const char *name)
575576
/* Linux requires all the references are released
576577
* before unregister
577578
*/
578-
if_rele(ifp);
579579
netmap_detach(ifp);
580+
if_rele(ifp);
580581
nm_os_vi_detach(ifp);
581582
return 0;
582583

0 commit comments

Comments
 (0)