summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_vr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/if_vr.c')
-rw-r--r--sys/pci/if_vr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index 340aac7..5eabc21 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -769,7 +769,6 @@ vr_attach(dev)
if (error) {
printf("vr%d: couldn't set up irq\n", unit);
ether_ifdetach(ifp);
- if_free(ifp);
goto fail;
}
@@ -804,9 +803,10 @@ vr_detach(device_t dev)
vr_stop(sc);
VR_UNLOCK(sc); /* XXX: Avoid recursive acquire. */
ether_ifdetach(ifp);
- if_free(ifp);
VR_LOCK(sc);
}
+ if (ifp)
+ if_free(ifp);
if (sc->vr_miibus)
device_delete_child(dev, sc->vr_miibus);
bus_generic_detach(dev);
OpenPOWER on IntegriCloud