linux/drivers/crypto/qat/qat_common
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
..
adf_accel_devices.h
adf_accel_engine.c
adf_admin.c cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
adf_aer.c PCI/AER: Remove pci_cleanup_aer_uncorrect_error_status() calls 2018-10-02 16:04:40 -05:00
adf_cfg_common.h
adf_cfg_strings.h
adf_cfg_user.h
adf_cfg.c crypto: qat - no need to check return value of debugfs_create functions 2019-02-01 14:42:03 +08:00
adf_cfg.h
adf_common_drv.h
adf_ctl_drv.c
adf_dev_mgr.c crypto: qat - remove unused and redundant pointer vf_info 2017-11-03 21:53:31 +08:00
adf_hw_arbiter.c
adf_init.c
adf_isr.c treewide: kzalloc_node() -> kcalloc_node() 2018-06-12 16:19:22 -07:00
adf_pf2vf_msg.c
adf_pf2vf_msg.h
adf_sriov.c
adf_transport_access_macros.h
adf_transport_debug.c crypto: qat - no need to check return value of debugfs_create functions 2019-02-01 14:42:03 +08:00
adf_transport_internal.h
adf_transport.c crypto: qat - Remove unused goto label 2019-02-08 15:30:09 +08:00
adf_transport.h
adf_vf2pf_msg.c
adf_vf_isr.c
icp_qat_fw_init_admin.h
icp_qat_fw_la.h
icp_qat_fw_loader_handle.h
icp_qat_fw_pke.h
icp_qat_fw.h
icp_qat_hal.h
icp_qat_hw.h
icp_qat_uclo.h
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qat_algs.c crypto: qat - return proper error code in setkey 2019-05-23 14:01:03 +08:00
qat_asym_algs.c crypto: rsa - unimplement sign/verify for raw RSA backends 2019-04-18 22:15:02 +08:00
qat_crypto.c
qat_crypto.h crypto: qat - update iv after encryption or decryption operations 2019-05-23 14:01:02 +08:00
qat_hal.c crypto: qat - reduce stack size with KASAN 2017-12-22 19:52:39 +11:00
qat_uclo.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00