[Midnightbsd-cvs] src [9480] trunk/usr.sbin/acpi/acpidump/acpi_user.c: Fix a long standing logic bug introduced in r167814.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Mar 5 15:00:48 EST 2017


Revision: 9480
          http://svnweb.midnightbsd.org/src/?rev=9480
Author:   laffer1
Date:     2017-03-05 15:00:48 -0500 (Sun, 05 Mar 2017)
Log Message:
-----------
Fix a long standing logic bug introduced in r167814.  The code was added to
get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code
and we always fell back to the previous method, i. e., sysctlbyname(3).

Obtained from: FreeBSD

Revision Links:
--------------
    http://svnweb.midnightbsd.org/src/?rev=167814

Modified Paths:
--------------
    trunk/usr.sbin/acpi/acpidump/acpi_user.c

Modified: trunk/usr.sbin/acpi/acpidump/acpi_user.c
===================================================================
--- trunk/usr.sbin/acpi/acpidump/acpi_user.c	2017-03-05 20:00:04 UTC (rev 9479)
+++ trunk/usr.sbin/acpi/acpidump/acpi_user.c	2017-03-05 20:00:48 UTC (rev 9480)
@@ -172,7 +172,7 @@
 	addr = 0;
 
 	/* Attempt to use kenv or sysctl to find RSD PTR record. */
-	if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) == 0)
+	if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) > 0)
 		addr = strtoul(buf, NULL, 0);
 	if (addr == 0) {
 		len = sizeof(addr);



More information about the Midnightbsd-cvs mailing list