crypto: inside-secure - fix an error handling path in safexcel_probe()
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Tue, 15 Aug 2017 19:33:24 +0000 (21:33 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 22 Aug 2017 06:54:55 +0000 (14:54 +0800)
'ret' is known to be 0 at this point.
If 'safexcel_request_ring_irq()' fails, it returns an error code.
Return this value instead of 0 which means success.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel.c

index 1fabd4aee81b75cd9e52785e6d09bb82dad58812..89ba9e85c0f377577c3e119bac5e7157372faed6 100644 (file)
@@ -839,9 +839,10 @@ static int safexcel_probe(struct platform_device *pdev)
                snprintf(irq_name, 6, "ring%d", i);
                irq = safexcel_request_ring_irq(pdev, irq_name, safexcel_irq_ring,
                                                ring_irq);
-
-               if (irq < 0)
+               if (irq < 0) {
+                       ret = irq;
                        goto err_clk;
+               }
 
                priv->ring[i].work_data.priv = priv;
                priv->ring[i].work_data.ring = i;