OSDN Git Service

crypto: caam - fix return code in completion callbacks
authorHoria Geantă <horia.geanta@nxp.com>
Wed, 31 Jul 2019 13:08:03 +0000 (16:08 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:11:45 +0000 (15:11 +1000)
commit1984aaeec372fbfb597883074253d290cbd543d4
treef995121d01975b730d6b078b8ecf0388d55923e2
parent51fab3d73054ca5b06b26e20edac0486b052c6f4
crypto: caam - fix return code in completion callbacks

Modify drive to provide a valid errno (and not the HW error ID)
to the user, via completion callbacks.

A "valid errno" is currently not explicitly mentioned in the docs,
however the error code is expected to match the one returned by the
generic SW implementation.

Note: in most error cases caam/qi and caam/qi2 returned -EIO; align all
caam drivers to return -EINVAL.

While here, ratelimit prints triggered by fuzz testing, such that
console is not flooded.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_qi.c
drivers/crypto/caam/caamalg_qi2.c
drivers/crypto/caam/caamhash.c
drivers/crypto/caam/caampkc.c
drivers/crypto/caam/error.c
drivers/crypto/caam/error.h
drivers/crypto/caam/key_gen.c
drivers/crypto/caam/qi.c