Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164219826
D58376.id182662.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58376.id182662.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D58376: iflib: clean up correctly when device attach fails
Attached
Detach File
Event Timeline
Log In to Comment