crypto: mxs-dcp - Fix platform_get_irq() error handling
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 14 Feb 2014 03:04:44 +0000 (01:04 -0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 26 Feb 2014 21:56:54 +0000 (05:56 +0800)
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>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/mxs-dcp.c

index 37e0706707027d291ad9ad347dadde13852b8ba7..08761d61d4f584bc273d112ca534fe37b3ab7ca2 100644 (file)
@@ -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;
        }