Commit 3b405e30 authored by Chris Packham's avatar Chris Packham Committed by Borislav Petkov

EDAC, mv64x60: Sanity check edac_op_state before registering

edac_op_state is a module parameter which affects the behaviour of
the driver probe which can potentially be invoked as soon as the
platform driver registration happens. Because of this we need to
ensure that we sanity check the module parameter before calling
platform_register_drivers().
Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170607215530.8604-1-chris.packham@alliedtelesis.co.nzSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent cf978258
...@@ -853,11 +853,6 @@ static struct platform_driver * const drivers[] = { ...@@ -853,11 +853,6 @@ static struct platform_driver * const drivers[] = {
static int __init mv64x60_edac_init(void) static int __init mv64x60_edac_init(void)
{ {
int ret;
ret = platform_register_drivers(drivers, ARRAY_SIZE(drivers));
if (ret)
return ret;
printk(KERN_INFO "Marvell MV64x60 EDAC driver " MV64x60_REVISION "\n"); printk(KERN_INFO "Marvell MV64x60 EDAC driver " MV64x60_REVISION "\n");
printk(KERN_INFO "\t(C) 2006-2007 MontaVista Software\n"); printk(KERN_INFO "\t(C) 2006-2007 MontaVista Software\n");
...@@ -872,7 +867,7 @@ static int __init mv64x60_edac_init(void) ...@@ -872,7 +867,7 @@ static int __init mv64x60_edac_init(void)
break; break;
} }
return 0; return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
} }
module_init(mv64x60_edac_init); module_init(mv64x60_edac_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment