From: tangchen Date: Mon, 6 Jan 2014 08:43:54 +0000 (+0800) Subject: ACPI / tables: Check if id is NULL in acpi_table_parse() X-Git-Tag: next-20140107~67^2~8^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=de2d1a7e9310c4d1464faf469c737f08b5608600;p=karo-tx-linux.git 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 Acked-by: Toshi Kani Signed-off-by: Rafael J. Wysocki --- 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) if (acpi_disabled) return -ENODEV; - if (!handler) + if (!id || !handler) return -EINVAL; if (strncmp(id, ACPI_SIG_MADT, 4) == 0)