svn commit: r236946 - stable/8/sys/dev/ae
Pyun YongHyeon
yongari at FreeBSD.org
Tue Jun 12 07:53:39 UTC 2012
Author: yongari
Date: Tue Jun 12 07:53:39 2012
New Revision: 236946
URL: http://svn.freebsd.org/changeset/base/236946
Log:
MFC 236649,236670:
Check the return value of pci_find_extcap()
Modified:
stable/8/sys/dev/ae/if_ae.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/boot/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/e1000/ (props changed)
Modified: stable/8/sys/dev/ae/if_ae.c
==============================================================================
--- stable/8/sys/dev/ae/if_ae.c Tue Jun 12 07:43:01 2012 (r236945)
+++ stable/8/sys/dev/ae/if_ae.c Tue Jun 12 07:53:39 2012 (r236946)
@@ -1382,12 +1382,13 @@ ae_pm_init(ae_softc_t *sc)
/*
* Configure PME.
*/
- pci_find_extcap(sc->dev, PCIY_PMG, &pmc);
- pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
- pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
- if ((ifp->if_capenable & IFCAP_WOL) != 0)
- pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
- pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
+ if (pci_find_extcap(sc->dev, PCIY_PMG, &pmc) == 0) {
+ pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
+ pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
+ if ((ifp->if_capenable & IFCAP_WOL) != 0)
+ pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
+ pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
+ }
}
static int
More information about the svn-src-all
mailing list