From owner-svn-src-all@freebsd.org Mon Apr 20 18:01:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFBD62A965F; Mon, 20 Apr 2020 18:01:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495ZJn4D3Dz3Ghn; Mon, 20 Apr 2020 18:01:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C2C81B635; Mon, 20 Apr 2020 18:01:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03KI1jII041335; Mon, 20 Apr 2020 18:01:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03KI1jTK041334; Mon, 20 Apr 2020 18:01:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202004201801.03KI1jTK041334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 Apr 2020 18:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360131 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 360131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 18:01:45 -0000 Author: cem Date: Mon Apr 20 18:01:45 2020 New Revision: 360131 URL: https://svnweb.freebsd.org/changeset/base/360131 Log: acpi_ec(4): Do not probe "successfully" if an error occurred All of the 'goto out;' cases in this probe routine without explicit initialization of 'ret' indicate error cases and were clearly intended to use the initial definition of 'ret' with ENXIO. However, 'ret' was accidentally squashed by reuse for a subroutine call near the beginning of probe. Use a different variable for the subroutine status to preserve ENXIO ret for the 'goto out's as a minimal solution to the panic reported at attach for now. PR: 245757 Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Mon Apr 20 17:48:10 2020 (r360130) +++ head/sys/dev/acpica/acpi_ec.c Mon Apr 20 18:01:45 2020 (r360131) @@ -344,7 +344,7 @@ acpi_ec_probe(device_t dev) device_t peer; char desc[64]; int ecdt; - int ret; + int ret, rc; struct acpi_ec_params *params; static char *ec_ids[] = { "PNP0C09", NULL }; @@ -368,9 +368,9 @@ acpi_ec_probe(device_t dev) } else ecdt = 0; - ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); - if (ret > 0) - return (ret); + rc = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); + if (rc > 0) + return (rc); params = malloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); @@ -398,7 +398,6 @@ acpi_ec_probe(device_t dev) peer = devclass_get_device(acpi_ec_devclass, params->uid); if (peer != NULL && device_is_alive(peer)) { device_disable(dev); - ret = ENXIO; goto out; }