]> err.no Git - linux-2.6/blobdiff - drivers/acpi/namespace/nsnames.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / acpi / namespace / nsnames.c
index cbd94af08cc5e00aa07c8c1075591c0124194700..cffef1bcbdbc3dde9db746c19be2314a6bc67d0c 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -180,6 +180,12 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
        next_node = node;
 
        while (next_node && (next_node != acpi_gbl_root_node)) {
+               if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
+                       ACPI_ERROR((AE_INFO,
+                                   "Invalid NS Node (%p) while traversing path",
+                                   next_node));
+                       return 0;
+               }
                size += ACPI_PATH_SEGMENT_LENGTH;
                next_node = acpi_ns_get_parent_node(next_node);
        }