linux/drivers/crypto/qat
Giovanni Cabiddu 92fec16d1f crypto: qat - return proper error code in setkey
If an invalid key is provided as input to the setkey function, the
function always failed returning -ENOMEM rather than -EINVAL.
Furthermore, if setkey was called multiple times with an invalid key,
the device instance was getting leaked.

This patch fixes the error paths in the setkey functions by returning
the correct error code in case of error and freeing all the resources
allocated in this function in case of failure.

This problem was found with by the new extra run-time crypto self test.

Reviewed-by: Conor Mcloughlin <conor.mcloughlin@intel.com>
Tested-by: Sergey Portnoy <sergey.portnoy@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-05-23 14:01:03 +08:00
..
qat_c3xxx crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
qat_c3xxxvf crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
qat_c62x crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
qat_c62xvf crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
qat_common crypto: qat - return proper error code in setkey 2019-05-23 14:01:03 +08:00
qat_dh895xcc crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
qat_dh895xccvf crypto: prefix header search paths with $(srctree)/ 2019-02-01 14:42:05 +08:00
Kconfig crypto: qat - Add DH support 2016-07-11 18:03:10 +08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00