From: Christophe JAILLET Date: Wed, 16 Aug 2017 04:58:21 +0000 (+0200) Subject: EDAC, thunderx: Fix error handling path in thunderx_lmc_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3eaef0fa39f7badb0bf25bb28ab96cf06b29d45c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git EDAC, thunderx: Fix error handling path in thunderx_lmc_probe() Return the proper error value if ioremap() fails (and not 0). Signed-off-by: Christophe JAILLET Cc: David Daney Cc: Ralf Baechle Cc: linux-edac Cc: linux-mips@linux-mips.org Link: http://lkml.kernel.org/r/20170816045821.14165-1-christophe.jaillet@wanadoo.fr [ Massage commit message, remove newline. ] Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index c8e8b9fd4772..f35d87519a3e 100644 --- a/drivers/edac/thunderx_edac.c +++ b/drivers/edac/thunderx_edac.c @@ -774,11 +774,10 @@ static int thunderx_lmc_probe(struct pci_dev *pdev, lmc->xor_bank = lmc_control & LMC_CONTROL_XOR_BANK; - l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), - PAGE_SIZE); - + l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), PAGE_SIZE); if (!l2c_ioaddr) { dev_err(&pdev->dev, "Cannot map L2C_CTL\n"); + ret = -ENOMEM; goto err_free; }