public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'
@ 2017-08-16  5:05 Christophe JAILLET
  2017-08-17 15:30 ` Thor Thayer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christophe JAILLET @ 2017-08-16  5:05 UTC (permalink / raw)
  To: thor.thayer, bp, mchehab
  Cc: linux-edac, linux-kernel, kernel-janitors, Christophe JAILLET

'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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-10 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16  5:05 [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()' Christophe JAILLET
2017-08-17 15:30 ` Thor Thayer
2017-08-18 16:24 ` Borislav Petkov
2018-06-10 15:34 ` [PATCH] EDAC, altera: Fix an error handling path in 'mv64x60_pci_err_probe()' Christophe JAILLET
2018-06-10 16:01 ` Christophe Jaillet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox