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>
This commit is contained in:
parent
6a368751d5
commit
de2d1a7e93
|
@ -293,7 +293,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
|
|||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
if (!handler)
|
||||
if (!id || !handler)
|
||||
return -EINVAL;
|
||||
|
||||
if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
|
||||
|
|
Loading…
Reference in New Issue