Index: sys/dev/bnxt/bnxt_en/if_bnxt.c =================================================================== --- sys/dev/bnxt/bnxt_en/if_bnxt.c +++ sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -2584,7 +2584,8 @@ HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX); if (rc) { device_printf(softc->dev, "attach: hwrm qportcfg (rx) failed\n"); - return rc; + goto failed; + } bnxt_verify_asym_queues(softc); } else { @@ -2610,7 +2611,7 @@ rc = bnxt_alloc_ctx_mem(softc); if (rc) { device_printf(softc->dev, "attach: alloc_ctx_mem failed\n"); - return rc; + goto failed; } rc = bnxt_hwrm_func_resc_qcaps(softc, true); if (!rc) @@ -2738,7 +2739,7 @@ rc = bnxt_init_sysctl_ctx(softc); if (rc) - goto init_sysctl_failed; + goto failed; if (BNXT_PF(softc)) { rc = bnxt_create_nvram_sysctls(softc->nvm_info); if (rc) @@ -2788,7 +2789,7 @@ failed: bnxt_free_sysctl_ctx(softc); -init_sysctl_failed: + bnxt_free_ctx_mem(softc); bnxt_hwrm_func_drv_unrgtr(softc, false); if (BNXT_PF(softc)) free(softc->nvm_info, M_DEVBUF); @@ -2810,6 +2811,7 @@ bnxt_pci_mapping_free(softc); pci_map_fail: pci_disable_busmaster(softc->dev); + SLIST_REMOVE(&pf_list, &softc->list, bnxt_softc_list, next); return (rc); }