mxge: properly remove the sysctls
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 13 Jul 2009 15:04:19 +0000 (18:04 +0300)
committerAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 13 Jul 2009 15:04:19 +0000 (18:04 +0300)
sys/dev/netif/mxge/if_mxge.c

index 5395c03..49e7684 100644 (file)
@@ -1456,10 +1456,6 @@ mxge_rem_sysctls(mxge_softc_t *sc)
        struct mxge_slice_state *ss;
        int slice;
 
-       if (sc->sysctl_tree != NULL) {
-               sysctl_ctx_free(&sc->sysctl_ctx);
-               sc->sysctl_tree = NULL;
-       }
        if (sc->slice_sysctl_tree == NULL)
                return;
 
@@ -1472,6 +1468,9 @@ mxge_rem_sysctls(mxge_softc_t *sc)
        }
        sysctl_ctx_free(&sc->slice_sysctl_ctx);
        sc->slice_sysctl_tree = NULL;
+       sysctl_ctx_free(&sc->sysctl_ctx);
+       sc->sysctl_tree = NULL;
+
 }
 
 static void