From a1a9c8f7e6df802ab28000373aaaaecfe8aaa89e Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Tue, 22 Jan 2002 17:51:44 +0000 Subject: [PATCH] Initialize the sysctl_ctx list early, which avoids a panic in case other allocatiosn fail and fxp_release() is called. --- sys/dev/fxp/if_fxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 006a2e8b184..ce3bde3d4ec 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -359,6 +359,7 @@ fxp_attach(device_t dev) bzero(sc, sizeof(*sc)); sc->dev = dev; callout_handle_init(&sc->stat_ch); + sysctl_ctx_init(&sc->sysctl_ctx); mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); s = splimp(); @@ -480,7 +481,6 @@ fxp_attach(device_t dev) /* * Create the sysctl tree */ - sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, device_get_nameunit(dev), CTLFLAG_RD, 0, "");