diff options
Diffstat (limited to 'drivers/acpi/namespace/nsnames.c')
-rw-r--r-- | drivers/acpi/namespace/nsnames.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index cffef1bcbdbc..549db42f16cf 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c | |||
@@ -137,6 +137,10 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) | |||
137 | /* Calculate required buffer size based on depth below root */ | 137 | /* Calculate required buffer size based on depth below root */ |
138 | 138 | ||
139 | size = acpi_ns_get_pathname_length(node); | 139 | size = acpi_ns_get_pathname_length(node); |
140 | if (!size) { | ||
141 | ACPI_ERROR((AE_INFO, "Invalid node failure")); | ||
142 | return_PTR(NULL); | ||
143 | } | ||
140 | 144 | ||
141 | /* Allocate a buffer to be returned to caller */ | 145 | /* Allocate a buffer to be returned to caller */ |
142 | 146 | ||
@@ -229,6 +233,10 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle, | |||
229 | /* Determine size required for the caller buffer */ | 233 | /* Determine size required for the caller buffer */ |
230 | 234 | ||
231 | required_size = acpi_ns_get_pathname_length(node); | 235 | required_size = acpi_ns_get_pathname_length(node); |
236 | if (!required_size) { | ||
237 | ACPI_ERROR((AE_INFO, "Invalid node failure")); | ||
238 | return_ACPI_STATUS(AE_ERROR); | ||
239 | } | ||
232 | 240 | ||
233 | /* Validate/Allocate/Clear caller buffer */ | 241 | /* Validate/Allocate/Clear caller buffer */ |
234 | 242 | ||