Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Provide the _COMPONENT definition and use ACPI_...
details: https://anonhg.NetBSD.org/src/rev/3e7a1d0799a1
branches: trunk
changeset: 752696:3e7a1d0799a1
user: jruoho <jruoho%NetBSD.org@localhost>
date: Thu Mar 04 08:44:55 2010 +0000
description:
Provide the _COMPONENT definition and use ACPI_FREE(x) instead of
AcpiOsFree(). If the memory tracking of ACPICA is enabled, the latter is
guaranteed to leak memory, possibly also corrupting kernel memory.
diffstat:
sys/dev/acpi/atk0110.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diffs (80 lines):
diff -r da9d44f3f864 -r 3e7a1d0799a1 sys/dev/acpi/atk0110.c
--- a/sys/dev/acpi/atk0110.c Thu Mar 04 08:13:29 2010 +0000
+++ b/sys/dev/acpi/atk0110.c Thu Mar 04 08:44:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atk0110.c,v 1.6 2010/03/02 18:44:47 jruoho Exp $ */
+/* $NetBSD: atk0110.c,v 1.7 2010/03/04 08:44:55 jruoho Exp $ */
/* $OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.6 2010/03/02 18:44:47 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.7 2010/03/04 08:44:55 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,6 +42,9 @@
* -- Constantine A. Murenin <http://cnst.su/>
*/
+#define _COMPONENT ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME ("acpi_aibs")
+
#define AIBS_MORE_SENSORS
struct aibs_sensor {
@@ -168,14 +171,14 @@
o = bp->Package.Elements;
if (o[0].Type != ACPI_TYPE_INTEGER) {
aprint_error_dev(self, "%s[0]: invalid type\n", name);
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
return;
}
n = o[0].Integer.Value;
if (bp->Package.Count - 1 < n) {
aprint_error_dev(self, "%s: invalid package\n", name);
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
return;
} else if (bp->Package.Count - 1 > n) {
int on = n;
@@ -189,14 +192,14 @@
if (n < 1) {
aprint_error_dev(self, "%s: no members in the package\n",
name);
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
return;
}
as = malloc(sizeof(*as) * n, M_DEVBUF, M_NOWAIT | M_ZERO);
if (as == NULL) {
aprint_error_dev(self, "%s: malloc fail\n", name);
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
return;
}
switch (st) {
@@ -255,7 +258,7 @@
name[0], i);
}
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
return;
}
@@ -327,7 +330,7 @@
}
bp = b.Pointer;
v = bp->Integer.Value;
- AcpiOsFree(b.Pointer);
+ ACPI_FREE(b.Pointer);
switch (st) {
case ENVSYS_STEMP:
Home |
Main Index |
Thread Index |
Old Index