From: Chris Packham Date: Mon, 29 May 2017 21:21:40 +0000 (+1200) Subject: EDAC, mv64x60: Check driver registration success X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d2fdaa694c596671c0d1d8d625966f7eb8cdea8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git EDAC, mv64x60: Check driver registration success Check the return status of platform_driver_register() in mv64x60_edac_init(). Only output messages and initialise the edac_op_state if the registration is successful. Signed-off-by: Chris Packham Cc: linux-edac Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20170529212142.25572-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/mv64x60_edac.c b/drivers/edac/mv64x60_edac.c index 6859bba1a133..77bfc3d882a8 100644 --- a/drivers/edac/mv64x60_edac.c +++ b/drivers/edac/mv64x60_edac.c @@ -853,10 +853,15 @@ static struct platform_driver * const drivers[] = { static int __init mv64x60_edac_init(void) { - int ret = 0; + 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"); + /* make sure error reporting method is sane */ switch (edac_op_state) { case EDAC_OPSTATE_POLL: @@ -867,7 +872,7 @@ static int __init mv64x60_edac_init(void) break; } - return platform_register_drivers(drivers, ARRAY_SIZE(drivers)); + return 0; } module_init(mv64x60_edac_init);