[PATCH] crypto: qat - add check for adf_cfg_add_key_value_param

From: Chen Ni
Date: Tue Jun 04 2024 - 23:25:58 EST


Add check for the return value of adf_cfg_add_key_value_param() and
return the error if it fails in order to catch the error.

Fixes: 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")
Signed-off-by: Chen Ni <nichen@xxxxxxxxxxx>
---
drivers/crypto/intel/qat/qat_common/adf_sriov.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/intel/qat/qat_common/adf_sriov.c b/drivers/crypto/intel/qat/qat_common/adf_sriov.c
index 8d645e7e04aa..30ff9097f527 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_sriov.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_sriov.c
@@ -228,8 +228,10 @@ int adf_sriov_configure(struct pci_dev *pdev, int numvfs)
return ret;

val = 1;
- adf_cfg_add_key_value_param(accel_dev, ADF_GENERAL_SEC, ADF_SRIOV_ENABLED,
+ ret = adf_cfg_add_key_value_param(accel_dev, ADF_GENERAL_SEC, ADF_SRIOV_ENABLED,
&val, ADF_DEC);
+ if (ret)
+ return ret;

return numvfs;
}
--
2.25.1