Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660272 > unrolled thread

[PATCH] EDAC: mv64x60: sanity check edac_op_state before registering

Started byChris Packham <chris.packham@alliedtelesis.co.nz>
First post2017-06-08 00:00 +0200
Last post2017-06-09 12:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] EDAC: mv64x60: sanity check edac_op_state before registering Chris Packham <chris.packham@alliedtelesis.co.nz> - 2017-06-08 00:00 +0200
    Re: [PATCH] EDAC: mv64x60: sanity check edac_op_state before  registering Borislav Petkov <bp@alien8.de> - 2017-06-09 12:10 +0200

#1660272 — [PATCH] EDAC: mv64x60: sanity check edac_op_state before registering

FromChris Packham <chris.packham@alliedtelesis.co.nz>
Date2017-06-08 00:00 +0200
Subject[PATCH] EDAC: mv64x60: sanity check edac_op_state before registering
Message-ID<tPR9E-3Ll-17@gated-at.bofh.it>
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);
 
-- 
2.13.0

[toc] | [next] | [standalone]


#1662228 — Re: [PATCH] EDAC: mv64x60: sanity check edac_op_state before registering

FromBorislav Petkov <bp@alien8.de>
Date2017-06-09 12:10 +0200
SubjectRe: [PATCH] EDAC: mv64x60: sanity check edac_op_state before registering
Message-ID<tQp1E-dV-7@gated-at.bofh.it>
In reply to#1660272
On Thu, Jun 08, 2017 at 09:55:30AM +1200, Chris Packham wrote:
> 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(-)

Applied to

git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#for-next

Thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web