diff options
Diffstat (limited to 'sys/dev/dc')
-rw-r--r-- | sys/dev/dc/if_dc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 1dab374..8a9e8c6 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2310,7 +2310,6 @@ dc_attach(device_t dev) if (error) { device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); - if_free(ifp); goto fail; } @@ -2347,8 +2346,9 @@ dc_detach(device_t dev) DC_UNLOCK(sc); callout_drain(&sc->dc_stat_ch); ether_ifdetach(ifp); - if_free(ifp); } + if (ifp) + if_free(ifp); if (sc->dc_miibus) device_delete_child(dev, sc->dc_miibus); bus_generic_detach(dev); |