aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/enic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/enic')
-rw-r--r--sys/dev/enic/if_enic.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c
index aa80ee6bafde..afdc39685aee 100644
--- a/sys/dev/enic/if_enic.c
+++ b/sys/dev/enic/if_enic.c
@@ -984,6 +984,7 @@ enic_init(if_ctx_t ctx)
struct enic *enic;
if_softc_ctx_t scctx;
unsigned int index;
+ int error;
softc = iflib_get_softc(ctx);
scctx = softc->scctx;
@@ -1005,11 +1006,17 @@ enic_init(if_ctx_t ctx)
bcopy(if_getlladdr(softc->ifp), softc->lladdr, ETHER_ADDR_LEN);
enic_set_lladdr(softc);
+ /* Queue setup above needs normal stop cleanup even if enable fails. */
+ softc->stopped = 0;
ENIC_LOCK(softc);
- vnic_dev_enable_wait(enic->vdev);
+ error = vnic_dev_enable_wait(enic->vdev);
ENIC_UNLOCK(softc);
-
- softc->stopped = 0;
+ if (error != 0) {
+ device_printf(softc->dev, "Device enable failed: %d\n", error);
+ enic_stop(ctx);
+ iflib_init_failed(ctx);
+ return;
+ }
enic_link_status(softc);
}