From 8582cb4b0d7907a4fa98a69f5785a7d596ed3bb3 Mon Sep 17 00:00:00 2001 From: yongari Date: Mon, 24 Aug 2009 20:37:15 +0000 Subject: Don't try to power down PHY when alc(4) failed to map the device. This fixes system crash when mapping alc(4) device failed in device attach. Reported by: Jim < stapleton.41 <> gmail DOT com > MFC after: 3 days --- sys/dev/alc/if_alc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index f3483b7..a53af77 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -858,7 +858,8 @@ alc_detach(device_t dev) sc->alc_intrhand[i] = NULL; } } - alc_phy_down(sc); + if (sc->alc_res[0] != NULL) + alc_phy_down(sc); bus_release_resources(dev, sc->alc_irq_spec, sc->alc_irq); if ((sc->alc_flags & (ALC_FLAG_MSI | ALC_FLAG_MSIX)) != 0) pci_release_msi(dev); -- cgit v1.1