summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-09-23 18:12:04 -0300
committerHerbert Xu <herbert@gondor.apana.org.au>2013-10-07 14:16:54 +0800
commitac1ed0c0e1a3b52cac89aae92ebc55fd4c19be77 (patch)
tree6c3c3f29f26373a9aae85ffbe4f24af8be84f60f
parent48e6dc1b2a1ad8186d48968d5018912bdacac744 (diff)
downloadblackbird-op-linux-ac1ed0c0e1a3b52cac89aae92ebc55fd4c19be77.tar.gz
blackbird-op-linux-ac1ed0c0e1a3b52cac89aae92ebc55fd4c19be77.zip
crypto: dcp - Check the return value from devm_ioremap_resource()
devm_ioremap_resource() may fail, so better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/dcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c
index 7b77c8457854..247ab8048f5b 100644
--- a/drivers/crypto/dcp.c
+++ b/drivers/crypto/dcp.c
@@ -734,6 +734,8 @@ static int dcp_probe(struct platform_device *pdev)
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->dcp_regs_base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(dev->dcp_regs_base))
+ return PTR_ERR(dev->dcp_regs_base);
dcp_set(dev, DCP_CTRL_SFRST, DCP_REG_CTRL);
udelay(10);
OpenPOWER on IntegriCloud