mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Initialize the sysctl_ctx list early, which avoids a panic in case other
allocatiosn fail and fxp_release() is called.
This commit is contained in:
parent
81c9105585
commit
a1a9c8f7e6
1 changed files with 1 additions and 1 deletions
|
|
@ -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, "");
|
||||
|
|
|
|||
Loading…
Reference in a new issue