Date: Tue, 9 Jun 2015 23:13:37 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284195 - head/sys/dev/acpica Message-ID: <201506092313.t59NDb3o085260@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Tue Jun 9 23:13:37 2015 New Revision: 284195 URL: https://svnweb.freebsd.org/changeset/base/284195 Log: Check status of AcpiReadBitRegister() calls. Reported by: Coverity CID: 1306132 Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Jun 9 22:13:53 2015 (r284194) +++ head/sys/dev/acpica/acpi_cpu.c Tue Jun 9 23:13:37 2015 (r284195) @@ -1074,6 +1074,7 @@ acpi_cpu_idle(sbintime_t sbt) struct acpi_cx *cx_next; uint64_t cputicks; uint32_t start_time, end_time; + ACPI_STATUS status; int bm_active, cx_next_idx, i, us; /* @@ -1119,8 +1120,8 @@ acpi_cpu_idle(sbintime_t sbt) */ if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 && cx_next_idx > sc->cpu_non_c3) { - AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); - if (bm_active != 0) { + status = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); + if (ACPI_SUCCESS(status) && bm_active != 0) { AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); cx_next_idx = sc->cpu_non_c3; } @@ -1285,6 +1286,7 @@ acpi_cpu_quirks_piix4(void) #ifdef __i386__ device_t acpi_dev; uint32_t val; + ACPI_STATUS status; acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3); if (acpi_dev != NULL) { @@ -1323,8 +1325,8 @@ acpi_cpu_quirks_piix4(void) val |= PIIX4_STOP_BREAK_MASK; pci_write_config(acpi_dev, PIIX4_DEVACTB_REG, val, 4); } - AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); - if (val) { + status = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); + if (ACPI_SUCCESS(status) && val != 0) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu: PIIX4: reset BRLD_EN_BM\n")); AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506092313.t59NDb3o085260>