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


Groups > linux.kernel > #1712684 > unrolled thread

[PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-08-16 07:10 +0200
Last post2017-08-18 18:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-16 07:10 +0200
    Re: [PATCH] EDAC, altera: Fix an error handling path in  'altr_edac_device_probe()' Thor Thayer <thor.thayer@linux.intel.com> - 2017-08-17 17:30 +0200
      Re: [PATCH] EDAC, altera: Fix an error handling path in  'altr_edac_device_probe()' Borislav Petkov <bp@alien8.de> - 2017-08-18 18:30 +0200

#1712684 — [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-08-16 07:10 +0200
Subject[PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'
Message-ID<ueYKB-2PV-5@gated-at.bofh.it>
'res' is known to be 0 at this point.
If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means
success.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/edac/altera_edac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index fa2e5db56d24..346c4987b284 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -747,8 +747,10 @@ static int altr_edac_device_probe(struct platform_device *pdev)
 	drvdata->edac_dev_name = ecc_name;
 
 	drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
-	if (!drvdata->base)
+	if (!drvdata->base) {
+		res = -ENOMEM;
 		goto fail1;
+	}
 
 	/* Get driver specific data for this EDAC device */
 	drvdata->data = of_match_node(altr_edac_device_of_match, np)->data;
-- 
2.11.0

[toc] | [next] | [standalone]


#1714143 — Re: [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

FromThor Thayer <thor.thayer@linux.intel.com>
Date2017-08-17 17:30 +0200
SubjectRe: [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'
Message-ID<ufuUa-6IK-27@gated-at.bofh.it>
In reply to#1712684
On 08/16/2017 12:05 AM, Christophe JAILLET wrote:
> 'res' is known to be 0 at this point.
> If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means
> success.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/edac/altera_edac.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index fa2e5db56d24..346c4987b284 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -747,8 +747,10 @@ static int altr_edac_device_probe(struct platform_device *pdev)
>   	drvdata->edac_dev_name = ecc_name;
>   
>   	drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
> -	if (!drvdata->base)
> +	if (!drvdata->base) {
> +		res = -ENOMEM;
>   		goto fail1;
> +	}
>   
>   	/* Get driver specific data for this EDAC device */
>   	drvdata->data = of_match_node(altr_edac_device_of_match, np)->data;
> 
Thank you for this patch!

Acked-by: Thor Thayer <thor.thayer@linux.intel.com>

[toc] | [prev] | [next] | [standalone]


#1715307 — Re: [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

FromBorislav Petkov <bp@alien8.de>
Date2017-08-18 18:30 +0200
SubjectRe: [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'
Message-ID<ufSjM-6dn-17@gated-at.bofh.it>
In reply to#1714143
On Thu, Aug 17, 2017 at 10:30:23AM -0500, Thor Thayer wrote:
> 
> On 08/16/2017 12:05 AM, Christophe JAILLET wrote:
> > 'res' is known to be 0 at this point.
> > If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means
> > success.
> > 
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > ---
> >   drivers/edac/altera_edac.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> > index fa2e5db56d24..346c4987b284 100644
> > --- a/drivers/edac/altera_edac.c
> > +++ b/drivers/edac/altera_edac.c
> > @@ -747,8 +747,10 @@ static int altr_edac_device_probe(struct platform_device *pdev)
> >   	drvdata->edac_dev_name = ecc_name;
> >   	drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
> > -	if (!drvdata->base)
> > +	if (!drvdata->base) {
> > +		res = -ENOMEM;
> >   		goto fail1;
> > +	}
> >   	/* Get driver specific data for this EDAC device */
> >   	drvdata->data = of_match_node(altr_edac_device_of_match, np)->data;
> > 
> Thank you for this patch!
> 
> Acked-by: Thor Thayer <thor.thayer@linux.intel.com>

Applied, 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