Skip to content

Commit

Permalink
RAS/CEC: Fix cec_init() prototype
Browse files Browse the repository at this point in the history
[ Upstream commit 85e6084 ]

late_initcall() expects a function that returns an integer. Update the
function signature to match.

 [ bp: Massage commit message into proper sentences. ]

Fixes: 9554bfe ("x86/mce: Convert the CEC to use the MCE notifier")
Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lkml.kernel.org/r/20200805095708.83939-1-luca.stefani.ge1@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
luca020400 authored and gregkh committed Oct 29, 2020
1 parent 19212b1 commit 03e0226
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/ras/cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,20 +553,20 @@ static struct notifier_block cec_nb = {
.priority = MCE_PRIO_CEC,
};

static void __init cec_init(void)
static int __init cec_init(void)
{
if (ce_arr.disabled)
return;
return -ENODEV;

ce_arr.array = (void *)get_zeroed_page(GFP_KERNEL);
if (!ce_arr.array) {
pr_err("Error allocating CE array page!\n");
return;
return -ENOMEM;
}

if (create_debugfs_nodes()) {
free_page((unsigned long)ce_arr.array);
return;
return -ENOMEM;
}

INIT_DELAYED_WORK(&cec_work, cec_work_fn);
Expand All @@ -575,6 +575,7 @@ static void __init cec_init(void)
mce_register_decode_chain(&cec_nb);

pr_info("Correctable Errors collector initialized.\n");
return 0;
}
late_initcall(cec_init);

Expand Down

0 comments on commit 03e0226

Please sign in to comment.