diff options
author | jlemon <jlemon@FreeBSD.org> | 2002-01-22 17:51:44 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2002-01-22 17:51:44 +0000 |
commit | 864702ba0c8407c0db9c52c517dc6571d1b09cbc (patch) | |
tree | 222e7ec37c068e812c2888c75718ca0851f854b7 /sys | |
parent | 82e60e977e09677cc8ae6fd0775889e622464dfe (diff) | |
download | FreeBSD-src-864702ba0c8407c0db9c52c517dc6571d1b09cbc.zip FreeBSD-src-864702ba0c8407c0db9c52c517dc6571d1b09cbc.tar.gz |
Initialize the sysctl_ctx list early, which avoids a panic in case other
allocatiosn fail and fxp_release() is called.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 006a2e8..ce3bde3 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, ""); |