summaryrefslogtreecommitdiffstats
path: root/sys/dev/alc
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-08-24 20:37:15 +0000
committeryongari <yongari@FreeBSD.org>2009-08-24 20:37:15 +0000
commit8582cb4b0d7907a4fa98a69f5785a7d596ed3bb3 (patch)
treec03f86475133d2f4e9101bc19eb9b481c0445e39 /sys/dev/alc
parent9bf71331601c3a78d0d799fb3a17acb9014b60fe (diff)
downloadFreeBSD-src-8582cb4b0d7907a4fa98a69f5785a7d596ed3bb3.zip
FreeBSD-src-8582cb4b0d7907a4fa98a69f5785a7d596ed3bb3.tar.gz
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
Diffstat (limited to 'sys/dev/alc')
-rw-r--r--sys/dev/alc/if_alc.c3
1 files changed, 2 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud