diff options
-rw-r--r-- | sys/net/iflib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c index fc4b94ea52df..11a95897f3c9 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4453,7 +4453,8 @@ fail_intr_free: 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 @@ iflib_qset_structures_setup(if_ctx_t ctx) { 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); } |