From: Christophe JAILLET Date: Wed, 16 Aug 2017 05:05:06 +0000 (+0200) Subject: EDAC, altera: Fix error handling path in altr_edac_device_probe() X-Git-Tag: v4.14-rc1~145^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b073d945cd31165591bdebc54dc1fded88b4ef3;p=platform%2Fkernel%2Flinux-rpi.git EDAC, altera: Fix error handling path in altr_edac_device_probe() Return the proper error value if devm_ioremap() fails (and not 0). Signed-off-by: Christophe JAILLET Acked-by: Thor Thayer Cc: linux-edac Link: http://lkml.kernel.org/r/20170816050506.14541-1-christophe.jaillet@wanadoo.fr [ Massage commit message. ] Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index fa2e5db..346c498 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;