diff options
-rw-r--r-- | drivers/acpi/namespace/nsnames.c | 8 | ||||
-rw-r--r-- | drivers/acpi/utilities/utalloc.c | 4 |
2 files changed, 12 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 | ||
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index 3dfb8a442b26..e7bf34a7b1d2 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c | |||
@@ -242,6 +242,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, | |||
242 | { | 242 | { |
243 | acpi_status status = AE_OK; | 243 | acpi_status status = AE_OK; |
244 | 244 | ||
245 | if (!required_length) { | ||
246 | WARN_ON(1); | ||
247 | return AE_ERROR; | ||
248 | } | ||
245 | switch (buffer->length) { | 249 | switch (buffer->length) { |
246 | case ACPI_NO_BUFFER: | 250 | case ACPI_NO_BUFFER: |
247 | 251 | ||