diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-08-16 00:58:21 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2017-08-18 13:12:08 -0400 |
commit | 3eaef0fa39f7badb0bf25bb28ab96cf06b29d45c (patch) | |
tree | a8c156d4e0debe3932d050cfcd01285202cc2df4 | |
parent | 8b073d945cd31165591bdebc54dc1fded88b4ef3 (diff) |
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 <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>
-rw-r--r-- | drivers/edac/thunderx_edac.c | 5 |
1 files changed, 2 insertions, 3 deletions
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, | |||
774 | 774 | ||
775 | lmc->xor_bank = lmc_control & LMC_CONTROL_XOR_BANK; | 775 | lmc->xor_bank = lmc_control & LMC_CONTROL_XOR_BANK; |
776 | 776 | ||
777 | l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), | 777 | l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), PAGE_SIZE); |
778 | PAGE_SIZE); | ||
779 | |||
780 | if (!l2c_ioaddr) { | 778 | if (!l2c_ioaddr) { |
781 | dev_err(&pdev->dev, "Cannot map L2C_CTL\n"); | 779 | dev_err(&pdev->dev, "Cannot map L2C_CTL\n"); |
780 | ret = -ENOMEM; | ||
782 | goto err_free; | 781 | goto err_free; |
783 | } | 782 | } |
784 | 783 | ||