Date: Mon, 20 Apr 2020 18:01:45 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360131 - head/sys/dev/acpica Message-ID: <202004201801.03KI1jTK041334@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004201801.03KI1jTK041334>