diff options
author | tangchen <tangchen@cn.fujitsu.com> | 2014-01-06 03:43:54 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-06 06:33:05 -0500 |
commit | de2d1a7e9310c4d1464faf469c737f08b5608600 (patch) | |
tree | ae884687c79a68cd9ed28f01813402ba6f5dbe16 /drivers/acpi | |
parent | 6a368751d54ed80e6ba868c29a04ad5118fe104b (diff) |
ACPI / tables: Check if id is NULL in acpi_table_parse()
strncmp() does not check if the params are NULL. In acpi_table_parse(),
if @id is NULL, the kernel will panic.
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/tables.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 4ec44258e4ff..a17619bfb57b 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -293,7 +293,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) | |||
293 | if (acpi_disabled) | 293 | if (acpi_disabled) |
294 | return -ENODEV; | 294 | return -ENODEV; |
295 | 295 | ||
296 | if (!handler) | 296 | if (!id || !handler) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | 298 | ||
299 | if (strncmp(id, ACPI_SIG_MADT, 4) == 0) | 299 | if (strncmp(id, ACPI_SIG_MADT, 4) == 0) |