Page MenuHomeFreeBSD

D58376.id182662.diff
No OneTemporary

D58376.id182662.diff

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5223,7 +5223,7 @@
/* Get memory for the station queues */
if ((err = iflib_queues_alloc(ctx))) {
device_printf(dev, "Unable to allocate queue memory\n");
- goto fail_intr_free;
+ goto fail_detach_driver;
}
if ((err = iflib_qset_structures_setup(ctx)))
@@ -5329,8 +5329,6 @@
ether_ifdetach(ctx->ifc_ifp);
CTX_LOCK(ctx);
fail_queues:
- sysctl_ctx_free(&ctx->ifc_sysctl_ctx);
- ctx->ifc_sysctl_node = NULL;
/*
* Drain without holding CTX_LOCK so _task_fn_admin can run to
* completion if it needs the context lock. On fail_detach we already
@@ -5342,7 +5340,11 @@
iflib_tqg_detach(ctx);
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
+fail_detach_driver:
/*
+ * iflib_queues_alloc() releases its own queue memory, so that failure
+ * path joins here rather than at fail_queues.
+ *
* Match iflib_device_deregister: IFDI_DETACH before taskqueue_free.
* Avoid IFNET_WLOCK across driver detach (LinuxKPI workqueue drain).
*/
@@ -5351,11 +5353,12 @@
IFDI_QUEUES_FREE(ctx);
IFNET_WLOCK();
taskqueue_free(ctx->ifc_tq);
-fail_intr_free:
iflib_free_intr_mem(ctx);
fail_unlock:
CTX_UNLOCK(ctx);
IFNET_WUNLOCK();
+ sysctl_ctx_free(&ctx->ifc_sysctl_ctx);
+ ctx->ifc_sysctl_node = NULL;
iflib_deregister(ctx);
device_set_softc(ctx->ifc_dev, NULL);
if (ctx->ifc_flags & IFC_SC_ALLOCATED)

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 30, 6:36 PM (1 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35512514
Default Alt Text
D58376.id182662.diff (1 KB)

Event Timeline