Index: head/sys/net/iflib.c =================================================================== --- head/sys/net/iflib.c +++ head/sys/net/iflib.c @@ -4453,7 +4453,8 @@ if (scctx->isc_intr == IFLIB_INTR_MSIX || scctx->isc_intr == IFLIB_INTR_MSI) pci_release_msi(ctx->ifc_dev); fail_queues: - /* XXX free queues */ + iflib_tx_structures_free(ctx); + iflib_rx_structures_free(ctx); fail: IFDI_DETACH(ctx); CTX_UNLOCK(ctx); @@ -5065,14 +5066,16 @@ { int err; + /* + * It is expected that the caller takes care of freeing queues if this + * fails. + */ if ((err = iflib_tx_structures_setup(ctx)) != 0) return (err); - if ((err = iflib_rx_structures_setup(ctx)) != 0) { + if ((err = iflib_rx_structures_setup(ctx)) != 0) device_printf(ctx->ifc_dev, "iflib_rx_structures_setup failed: %d\n", err); - iflib_tx_structures_free(ctx); - iflib_rx_structures_free(ctx); - } + return (err); }