Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: mxs-dcp: Fix platform_get_irq() error handling
@ 2014-02-14  3:04 Fabio Estevam
  2014-02-14  8:22 ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2014-02-14  3:04 UTC (permalink / raw)
  To: herbert; +Cc: marex, linux-crypto, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/crypto/mxs-dcp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index 37e0706..08761d6 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -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;
 	}
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-25 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14  3:04 [PATCH] crypto: mxs-dcp: Fix platform_get_irq() error handling Fabio Estevam
2014-02-14  8:22 ` Marek Vasut
2014-02-25 12:18   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox