Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Be consistent with the returned exception codes...



details:   https://anonhg.NetBSD.org/src/rev/d1c2c2c1cde7
branches:  trunk
changeset: 754309:d1c2c2c1cde7
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Apr 27 08:15:07 2010 +0000

description:
Be consistent with the returned exception codes. Check for NULL pointers.

diffstat:

 sys/dev/acpi/acpi_util.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r f2c444a71f0a -r d1c2c2c1cde7 sys/dev/acpi/acpi_util.c
--- a/sys/dev/acpi/acpi_util.c  Tue Apr 27 05:57:43 2010 +0000
+++ b/sys/dev/acpi/acpi_util.c  Tue Apr 27 08:15:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_util.c,v 1.3 2010/04/24 06:57:10 jruoho Exp $ */
+/*     $NetBSD: acpi_util.c,v 1.4 2010/04/27 08:15:07 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.3 2010/04/24 06:57:10 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.4 2010/04/27 08:15:07 jruoho Exp $");
 
 #include <sys/param.h>
 
@@ -228,9 +228,12 @@
        ACPI_STATUS rv = AE_OK;
        uint32_t i;
 
-       if (pkg == NULL || pkg->Type != ACPI_TYPE_PACKAGE)
+       if (pkg == NULL)
                return AE_BAD_PARAMETER;
 
+       if (pkg->Type != ACPI_TYPE_PACKAGE)
+               return AE_TYPE;
+
        for (i = 0; i < pkg->Package.Count; i++) {
 
                rv = (*func)(&pkg->Package.Elements[i], arg);
@@ -295,6 +298,9 @@
        ACPI_BUFFER buf;
        ACPI_STATUS rv;
 
+       if (handle == NULL)
+               handle = ACPI_ROOT_OBJECT;
+
        buf.Pointer = name;
        buf.Length = sizeof(name);
 



Home | Main Index | Thread Index | Old Index