aboutsummaryrefslogtreecommitdiff
path: root/sys/net/iflib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/iflib.c')
-rw-r--r--sys/net/iflib.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index cfc6972bf987..cce56d0e7335 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -4900,7 +4900,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
device_printf(dev,
"Cannot use iflib with only 1 MSI-X interrupt!\n");
err = ENODEV;
- goto fail_intr_free;
+ goto fail_queues;
}
ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet);
@@ -4936,13 +4936,14 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
fail_detach:
ether_ifdetach(ctx->ifc_ifp);
-fail_intr_free:
- iflib_free_intr_mem(ctx);
fail_queues:
+ iflib_tqg_detach(ctx);
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
- iflib_tqg_detach(ctx);
IFDI_DETACH(ctx);
+ IFDI_QUEUES_FREE(ctx);
+fail_intr_free:
+ iflib_free_intr_mem(ctx);
fail_unlock:
CTX_UNLOCK(ctx);
iflib_deregister(ctx);
@@ -5139,11 +5140,12 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sctx, if_ctx_t *ctxp,
fail_detach:
ether_ifdetach(ctx->ifc_ifp);
fail_queues:
+ iflib_tqg_detach(ctx);
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
- iflib_tqg_detach(ctx);
fail_iflib_detach:
IFDI_DETACH(ctx);
+ IFDI_QUEUES_FREE(ctx);
fail_unlock:
CTX_UNLOCK(ctx);
iflib_deregister(ctx);
@@ -5173,6 +5175,8 @@ iflib_pseudo_deregister(if_ctx_t ctx)
iflib_tqg_detach(ctx);
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
+ IFDI_DETACH(ctx);
+ IFDI_QUEUES_FREE(ctx);
iflib_deregister(ctx);
@@ -5233,8 +5237,12 @@ iflib_device_deregister(if_ctx_t ctx)
led_destroy(ctx->ifc_led_dev);
iflib_tqg_detach(ctx);
+ iflib_tx_structures_free(ctx);
+ iflib_rx_structures_free(ctx);
+
CTX_LOCK(ctx);
IFDI_DETACH(ctx);
+ IFDI_QUEUES_FREE(ctx);
CTX_UNLOCK(ctx);
/* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/
@@ -5242,9 +5250,6 @@ iflib_device_deregister(if_ctx_t ctx)
bus_generic_detach(dev);
- iflib_tx_structures_free(ctx);
- iflib_rx_structures_free(ctx);
-
iflib_deregister(ctx);
device_set_softc(ctx->ifc_dev, NULL);
@@ -5828,7 +5833,6 @@ iflib_tx_structures_free(if_ctx_t ctx)
}
free(ctx->ifc_txqs, M_IFLIB);
ctx->ifc_txqs = NULL;
- IFDI_QUEUES_FREE(ctx);
}
/*********************************************************************