git: d5ad797c5e2a - main - acpi: Return the handle of a reference property, not its target

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Mon, 23 Nov 2026 23:50:46 UTC
The branch main has been updated by olivier:

URL: https://cgit.FreeBSD.org/src/commit/?id=d5ad797c5e2a3fb4920262fe4fbd966177022b1b

commit d5ad797c5e2a3fb4920262fe4fbd966177022b1b
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2026-11-22 23:47:23 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2026-11-23 23:45:11 +0000

    acpi: Return the handle of a reference property, not its target
    
    acpi_bus_get_prop() copied the first bytes of the namespace node a
    _DSD reference points to, instead of the handle itself, when a caller
    asked for such a property with a type other than DEVICE_PROP_HANDLE.
    
    Reviewed by:    wulf, imp
    Approved by:    wulf, imp
    Fixes:          99e6980fcf5e ("device_get_property: add a HANDLE case")
    MFC after:      1 week
    Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/117
---
 sys/dev/acpica/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index b283856ffe52..993203c5caab 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2161,7 +2161,7 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname,
 
 			h = acpi_GetReference(NULL,
 			    __DECONST(ACPI_OBJECT *, obj));
-			memcpy(propvalue, h, sizeof(ACPI_HANDLE));
+			memcpy(propvalue, &h, sizeof(ACPI_HANDLE));
 		}
 		return (sizeof(ACPI_HANDLE));
 	default: