From e8492b62f8e79721187d7dd2537936c4054edda4 Mon Sep 17 00:00:00 2001 From: soren Date: Mon, 2 Feb 2004 08:00:56 +0000 Subject: [PATCH] Log message from FreeBSD: When creating a package element via "Store(0xXXX, Index(ArgX, 0xXXX))", be sure to increment the refcount of the argument so it is not prematurely deleted. This is a workaround and may appear in a different form in ACPI-CA. This fixes battery evaluation on Thinkpads that was broken by fixing the Dell battery state. Submitted by: Luming Yu --- sys/dev/acpi/acpica/Subsystem/exstore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpi/acpica/Subsystem/exstore.c b/sys/dev/acpi/acpica/Subsystem/exstore.c index 27399562e263..026baba7a863 100644 --- a/sys/dev/acpi/acpica/Subsystem/exstore.c +++ b/sys/dev/acpi/acpica/Subsystem/exstore.c @@ -116,7 +116,7 @@ *****************************************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: exstore.c,v 1.9 2003/12/13 18:11:01 kochi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exstore.c,v 1.10 2004/02/02 08:00:56 soren Exp $"); #define __EXSTORE_C__ @@ -392,7 +392,7 @@ AcpiExStoreObjectToIndex ( /* If same as the original source, add a reference */ - if (NewDesc == SourceDesc) + if (NewDesc == SourceDesc || ObjDesc == NULL) { AcpiUtAddReference (NewDesc); }