From owner-svn-src-head@FreeBSD.ORG Tue Jun 9 23:13:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBA4CBFD; Tue, 9 Jun 2015 23:13:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9B7413B0; Tue, 9 Jun 2015 23:13:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t59NDbJ3085261; Tue, 9 Jun 2015 23:13:37 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t59NDb3o085260; Tue, 9 Jun 2015 23:13:37 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506092313.t59NDb3o085260@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 9 Jun 2015 23:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284195 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2015 23:13:38 -0000 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);