소스 검색

acpi: add checking for NULL early param

The early_param handling function could recieve NULL pointer as argument
in case if user didn't enter parameter value.  So we have to be ready for
a such situation and do check for NULL pointer if needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cyrill Gorcunov 17 년 전
부모
커밋
f0df2d6b52
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/acpi/tables.c

+ 2 - 0
drivers/acpi/tables.c

@@ -300,6 +300,8 @@ int __init acpi_table_init(void)
 
 
 static int __init acpi_parse_apic_instance(char *str)
 static int __init acpi_parse_apic_instance(char *str)
 {
 {
+	if (!str)
+		return -EINVAL;
 
 
 	acpi_apic_instance = simple_strtoul(str, NULL, 0);
 	acpi_apic_instance = simple_strtoul(str, NULL, 0);