Commit 0dd691b4 authored by Kyle Evans's avatar Kyle Evans
Browse files

iflib: allow clone detach if not yet init

If we hit an error during init, then we'll unwind our state and attempt
to detach the device -- don't block it.

This was discovered by creating a wg0 with missing parameters; said
failure ended up leaving this orphaned device in place and ended up
panicking the system upon enumeration of the dev.* sysctl space.

Reviewed by:	gallatin, markj
MFC after:	3 days
Differential Revision:
parent 299f8977
...@@ -83,7 +83,8 @@ iflib_pseudo_detach(device_t dev) ...@@ -83,7 +83,8 @@ iflib_pseudo_detach(device_t dev)
if_ctx_t ctx; if_ctx_t ctx;
ctx = device_get_softc(dev); ctx = device_get_softc(dev);
if ((iflib_get_flags(ctx) & IFC_IN_DETACH) == 0) if ((iflib_get_flags(ctx) & (IFC_INIT_DONE | IFC_IN_DETACH)) ==
return (EBUSY); return (EBUSY);
return (0); return (0);
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment