Skip to contentSkip to conversation

crypto: dcp: Check the return value from devm_ioremap_resource()

PATCH In review Fabio Estevam 2 participants 2 messages Sep 23, 2013 – Oct 7, 2013 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: dcp: Check the return value from devm_ioremap_resource()

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() may fail, so better check its return value and propagate it in the case of error.

---
 drivers/crypto/dcp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/crypto/dcp.c +2 -0
index 7b77c84..247ab80 100644
@@ -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);
Signature · 1 line
1.8.1.2
maintainer
#1 lore raw
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() may fail, so better check its return value and propagate it in the case of error.

Patch applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt