]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
EDAC, thunderx: Fix error handling path in thunderx_lmc_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 16 Aug 2017 04:58:21 +0000 (06:58 +0200)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Aug 2017 17:12:08 +0000 (19:12 +0200)
Return the proper error value if ioremap() fails (and not 0).

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: David Daney <david.daney@cavium.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-edac <linux-edac@vger.kernel.org>
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 <bp@suse.de>
drivers/edac/thunderx_edac.c

index c8e8b9fd477242c049a4df8a4ca4b308a6b04659..f35d87519a3e84824258a993141851afe0a438d4 100644 (file)
@@ -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;
        }