crypto: inside-secure - change returned error when a descriptor reports an error
authorAntoine Tenart <antoine.tenart@bootlin.com>
Mon, 27 May 2019 14:50:58 +0000 (16:50 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 6 Jun 2019 06:38:56 +0000 (14:38 +0800)
This patch changes the error reported by the Inside Secure SafeXcel
driver when a result descriptor reports an error, from -EIO to -EINVAL,
as this is what the crypto framework expects. This was found while
running the crypto extra tests.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel.c

index d5392893973c05868eb988d08bf43bc274cbf49d..316e5e4c1c74149b978dd613845581d483cd82e5 100644 (file)
@@ -591,7 +591,7 @@ inline int safexcel_rdesc_check_errors(struct safexcel_crypto_priv *priv,
                dev_err(priv->dev,
                        "cipher: result: result descriptor error (0x%x)\n",
                        rdesc->result_data.error_code);
-               return -EIO;
+               return -EINVAL;
        } else if (rdesc->result_data.error_code == BIT(9)) {
                /* Authentication failed */
                return -EBADMSG;