From 7ba33d8222c24e7b4e556a2f80abe4750abcfb90 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Sat, 11 Jun 2005 00:47:34 +0000 Subject: [PATCH] Move if_alloc() up in fxp_attach() so there's an ifp before mii_phy_probe() is called. Committed via: fxp0 --- sys/dev/fxp/if_fxp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 4fd50f93ac4..ca4de5ba325 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -388,6 +388,13 @@ fxp_attach(device_t dev) s = splimp(); + ifp = sc->ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "can not if_alloc()\n"); + error = ENOSPC; + goto fail; + } + /* * Enable bus mastering. */ @@ -745,12 +752,6 @@ fxp_attach(device_t dev) } } - ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_baudrate = 100000000; ifp->if_init = fxp_init;