Thread (2 messages) 2 messages, 2 authors, 2017-06-09

EDAC: mv64x60: sanity check edac_op_state before registering

From: Chris Packham <chris.packham@alliedtelesis.co.nz>
Date: 2017-06-07 21:55:37
Also in: lkml
Subsystem: edac-core, the rest · Maintainers: Borislav Petkov, Tony Luck, Linus Torvalds

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: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 drivers/edac/mv64x60_edac.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/edac/mv64x60_edac.c b/drivers/edac/mv64x60_edac.c
index c83d02a52fd6..9b18a0a606b7 100644
--- a/drivers/edac/mv64x60_edac.c
+++ b/drivers/edac/mv64x60_edac.c
@@ -867,11 +867,6 @@ static struct platform_driver * const drivers[] = {
 
 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 "\t(C) 2006-2007 MontaVista Software\n");
@@ -885,7 +880,7 @@ static int __init mv64x60_edac_init(void)
 		break;
 	}
 
-	return 0;
+	return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
 }
 module_init(mv64x60_edac_init);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help