Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi/wmi Initialize pointers to NULL. Otherwise we m...



details:   https://anonhg.NetBSD.org/src/rev/d0f7406673b8
branches:  trunk
changeset: 755949:d0f7406673b8
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Jun 30 07:58:11 2010 +0000

description:
Initialize pointers to NULL. Otherwise we may try to free garbage.
Tries to address a panic reported by David Demelier in PR kern/43504.

diffstat:

 sys/dev/acpi/wmi/wmi_dell.c |  6 ++++--
 sys/dev/acpi/wmi/wmi_hp.c   |  7 +++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (62 lines):

diff -r b69d5f4bca4b -r d0f7406673b8 sys/dev/acpi/wmi/wmi_dell.c
--- a/sys/dev/acpi/wmi/wmi_dell.c       Wed Jun 30 07:42:36 2010 +0000
+++ b/sys/dev/acpi/wmi/wmi_dell.c       Wed Jun 30 07:58:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wmi_dell.c,v 1.3 2010/04/08 12:14:19 jruoho Exp $ */
+/*     $NetBSD: wmi_dell.c,v 1.4 2010/06/30 07:58:11 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.3 2010/04/08 12:14:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_dell.c,v 1.4 2010/06/30 07:58:11 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -167,6 +167,8 @@
        ACPI_STATUS rv;
        uint32_t val;
 
+       buf.Pointer = NULL;
+
        sc = device_private(self);
        rv = acpi_wmi_event_get(sc->sc_parent, evt, &buf);
 
diff -r b69d5f4bca4b -r d0f7406673b8 sys/dev/acpi/wmi/wmi_hp.c
--- a/sys/dev/acpi/wmi/wmi_hp.c Wed Jun 30 07:42:36 2010 +0000
+++ b/sys/dev/acpi/wmi/wmi_hp.c Wed Jun 30 07:58:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wmi_hp.c,v 1.1 2010/04/08 17:32:30 jruoho Exp $ */
+/*     $NetBSD: wmi_hp.c,v 1.2 2010/06/30 07:58:11 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_hp.c,v 1.1 2010/04/08 17:32:30 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_hp.c,v 1.2 2010/06/30 07:58:11 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -252,6 +252,8 @@
        ACPI_STATUS rv;
        uint32_t val;
 
+       buf.Pointer = NULL;
+
        sc = device_private(self);
        rv = acpi_wmi_event_get(sc->sc_parent, evt, &buf);
 
@@ -343,6 +345,7 @@
        KDASSERT(cmd != 0);
        KDASSERT(sc->sc_arg[0] == WMI_HP_METHOD_ARG_MAGIC);
 
+       obuf.Pointer = NULL;
        ibuf.Pointer = sc->sc_arg;
        ibuf.Length = WMI_HP_METHOD_ARG_SIZE;
 



Home | Main Index | Thread Index | Old Index