Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Fix a memory leak/corruption by commenting out ...



details:   https://anonhg.NetBSD.org/src/rev/e72dbe2b4372
branches:  trunk
changeset: 750542:e72dbe2b4372
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Jan 05 13:47:52 2010 +0000

description:
Fix a memory leak/corruption by commenting out the evaluation of the _PSL
control method. If it is needed in the future, the output buffer must be
freed after use.

ok pgoyette@, jmcneill@

diffstat:

 sys/dev/acpi/acpi_tz.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r f3025f0d9618 -r e72dbe2b4372 sys/dev/acpi/acpi_tz.c
--- a/sys/dev/acpi/acpi_tz.c    Tue Jan 05 13:39:49 2010 +0000
+++ b/sys/dev/acpi/acpi_tz.c    Tue Jan 05 13:47:52 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_tz.c,v 1.53 2010/01/01 15:55:30 pgoyette Exp $ */
+/* $NetBSD: acpi_tz.c,v 1.54 2010/01/05 13:47:52 jruoho Exp $ */
 
 /*
  * Copyright (c) 2003 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.53 2010/01/01 15:55:30 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.54 2010/01/05 13:47:52 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -513,13 +513,16 @@
        acpitz_get_integer(dv, "_TMP", &sc->sc_zone.tmp);
        acpitz_get_integer(dv, "_CRT", &sc->sc_zone.crt);
        acpitz_get_integer(dv, "_HOT", &sc->sc_zone.hot);
+       acpitz_get_integer(dv, "_PSV", &sc->sc_zone.psv);
+       acpitz_get_integer(dv, "_TC1", &sc->sc_zone.tc1);
+       acpitz_get_integer(dv, "_TC2", &sc->sc_zone.tc2);
+
+#if 0
        sc->sc_zone.psl.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
        sc->sc_zone.psl.Pointer = NULL;
        AcpiEvaluateObject(sc->sc_devnode->ad_handle,
            "_PSL", NULL, &sc->sc_zone.psl);
-       acpitz_get_integer(dv, "_PSV", &sc->sc_zone.psv);
-       acpitz_get_integer(dv, "_TC1", &sc->sc_zone.tc1);
-       acpitz_get_integer(dv, "_TC2", &sc->sc_zone.tc2);
+#endif
 
        /* ACPI spec: If _RTV is not present or present and zero,
         * values are absolute. */



Home | Main Index | Thread Index | Old Index