diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-08-16 01:05:06 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2017-08-18 12:21:27 -0400 |
commit | 8b073d945cd31165591bdebc54dc1fded88b4ef3 (patch) | |
tree | f3d6153204c6858c1631771ce9981dd519b34ca7 | |
parent | 3e5d2bd19138d6683f69de26a34d7eb9ab3823ed (diff) |
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 <christophe.jaillet@wanadoo.fr>
Acked-by: Thor Thayer <thor.thayer@linux.intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170816050506.14541-1-christophe.jaillet@wanadoo.fr
[ Massage commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | drivers/edac/altera_edac.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
747 | drvdata->edac_dev_name = ecc_name; | 747 | drvdata->edac_dev_name = ecc_name; |
748 | 748 | ||
749 | drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); | 749 | drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); |
750 | if (!drvdata->base) | 750 | if (!drvdata->base) { |
751 | res = -ENOMEM; | ||
751 | goto fail1; | 752 | goto fail1; |
753 | } | ||
752 | 754 | ||
753 | /* Get driver specific data for this EDAC device */ | 755 | /* Get driver specific data for this EDAC device */ |
754 | drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; | 756 | drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; |