Skip to contentSkip to conversation

crypto: mxs-dcp: Fix platform_get_irq() error handling

PATCH In review Fabio Estevam 3 participants 3 messages Feb 14, 2014 – Feb 25, 2014

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 crypto: mxs-dcp: Fix platform_get_irq() error handling

From: Fabio Estevam <[email protected]>

We should test the error case for each platform_get_irq() assignment and propagate the error accordingly.

---
 drivers/crypto/mxs-dcp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/crypto/mxs-dcp.c +7 -2
index 37e0706..08761d6 100644
@@ -908,9 +908,14 @@ static int mxs_dcp_probe(struct platform_device *pdev)
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dcp_vmi_irq = platform_get_irq(pdev, 0);
+	if (dcp_vmi_irq < 0) {
+		ret = dcp_vmi_irq;
+		goto err_mutex;
+	}
+
 	dcp_irq = platform_get_irq(pdev, 1);
-	if (dcp_vmi_irq < 0 || dcp_irq < 0) {
-		ret = -EINVAL;
+	if (dcp_irq < 0) {
+		ret = dcp_irq;
 		goto err_mutex;
 	}
 
Signature · 1 line
1.8.1.2
maintainer
#2 lore raw
Quoted 9 lines · Marek Vasut
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

We should test the error case for each platform_get_irq() assignment and propagate the error accordingly.

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