diff options
Diffstat (limited to 'sys/dev/re')
| -rw-r--r-- | sys/dev/re/if_re.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index fc84ea9c175a1..9cc21aa626706 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1178,6 +1178,13 @@ re_attach(dev) if (error) goto fail; + ifp = sc->rl_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + printf("re%d: can not if_alloc()\n", sc->rl_unit); + error = ENOSPC; + goto fail; + } + /* Do MII setup */ if (mii_phy_probe(dev, &sc->rl_miibus, re_ifmedia_upd, re_ifmedia_sts)) { @@ -1186,12 +1193,6 @@ re_attach(dev) goto fail; } - ifp = sc->rl_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - printf("re%d: can not if_alloc()\n", sc->rl_unit); - error = ENOSPC; - goto fail; - } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; |
