diff options
Diffstat (limited to 'drivers/acpi/utilities/utalloc.c')
-rw-r--r-- | drivers/acpi/utilities/utalloc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index e7bf34a7b1d2..7dcb67e0b215 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c | |||
@@ -242,10 +242,12 @@ 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) { | 245 | /* Parameter validation */ |
246 | WARN_ON(1); | 246 | |
247 | return AE_ERROR; | 247 | if (!buffer || !required_length) { |
248 | return (AE_BAD_PARAMETER); | ||
248 | } | 249 | } |
250 | |||
249 | switch (buffer->length) { | 251 | switch (buffer->length) { |
250 | case ACPI_NO_BUFFER: | 252 | case ACPI_NO_BUFFER: |
251 | 253 | ||