diff options
author | Bob Moore <robert.moore@intel.com> | 2008-04-10 11:06:39 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 14:29:26 -0400 |
commit | d8841647de7c4aa3f3ff5b8b8c4a3f042e848ff0 (patch) | |
tree | c13984a05b5e742e86f07a762162d634404ec8ef /drivers/acpi/namespace/nsnames.c | |
parent | 98af37fba9b3e601ca4bded51ef51a2be4e8c97b (diff) |
ACPICA: Add error checks to prevent faults
Added additional error checking to prevent run-time faults.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nsnames.c')
-rw-r--r-- | drivers/acpi/namespace/nsnames.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index cbd94af08cc5..e14a1412656b 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c | |||
@@ -180,6 +180,12 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) | |||
180 | next_node = node; | 180 | next_node = node; |
181 | 181 | ||
182 | while (next_node && (next_node != acpi_gbl_root_node)) { | 182 | while (next_node && (next_node != acpi_gbl_root_node)) { |
183 | if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) { | ||
184 | ACPI_ERROR((AE_INFO, | ||
185 | "Invalid NS Node (%X) while traversing path", | ||
186 | next_node)); | ||
187 | return 0; | ||
188 | } | ||
183 | size += ACPI_PATH_SEGMENT_LENGTH; | 189 | size += ACPI_PATH_SEGMENT_LENGTH; |
184 | next_node = acpi_ns_get_parent_node(next_node); | 190 | next_node = acpi_ns_get_parent_node(next_node); |
185 | } | 191 | } |