Skip to content

Commit

Permalink
ACPI: APEI: fix return value of __setup handlers
Browse files Browse the repository at this point in the history
__setup() handlers should return 1 to indicate that the boot option
has been handled. Returning 0 causes a boot option to be listed in
the Unknown kernel command line parameters and also added to init's
arg list (if no '=' sign) or environment list (if of the form 'a=b').

Unknown kernel command line parameters "erst_disable
  bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be
  passed to user space.

 Run /sbin/init as init process
   with arguments:
     /sbin/init
     erst_disable
     bert_disable
     hest_disable
   with environment:
     HOME=/
     TERM=linux
     BOOT_IMAGE=/boot/bzImage-517rc6

Fixes: a3e2acc ("ACPI / APEI: Add Boot Error Record Table (BERT) support")
Fixes: a08f82d ("ACPI, APEI, Error Record Serialization Table (ERST) support")
Fixes: 9dc9666 ("ACPI, APEI, HEST table parsing")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Randy Dunlap authored and Rafael J. Wysocki committed Mar 8, 2022
1 parent 27e932a commit f3303ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/apei/bert.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int __init setup_bert_disable(char *str)
{
bert_disable = 1;

return 0;
return 1;
}
__setup("bert_disable", setup_bert_disable);

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(erst_clear);
static int __init setup_erst_disable(char *str)
{
erst_disable = 1;
return 0;
return 1;
}

__setup("erst_disable", setup_erst_disable);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
static int __init setup_hest_disable(char *str)
{
hest_disable = HEST_DISABLED;
return 0;
return 1;
}

__setup("hest_disable", setup_hest_disable);
Expand Down

0 comments on commit f3303ff

Please sign in to comment.