crypto: qat - fix error return code in adf_probe

Message ID 1669030054-9605-1-git-send-email-wangyufen@huawei.com
State New
Headers
Series crypto: qat - fix error return code in adf_probe |

Commit Message

wangyufen Nov. 21, 2022, 11:27 a.m. UTC
  Fix to return a negative error code -EINVAL instead of 0.

Fixes: 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
 drivers/crypto/qat/qat_4xxx/adf_drv.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Cabiddu, Giovanni Nov. 21, 2022, 11:51 a.m. UTC | #1
On Mon, Nov 21, 2022 at 07:27:34PM +0800, Wang Yufen wrote:
> Fix to return a negative error code -EINVAL instead of 0.
> 
> Fixes: 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
  
Herbert Xu Dec. 2, 2022, 10:18 a.m. UTC | #2
On Mon, Nov 21, 2022 at 07:27:34PM +0800, Wang Yufen wrote:
> Fix to return a negative error code -EINVAL instead of 0.
> 
> Fixes: 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
>  drivers/crypto/qat/qat_4xxx/adf_drv.c | 1 +
>  1 file changed, 1 insertion(+)

Patch applied.  Thanks.
  

Patch

diff --git a/drivers/crypto/qat/qat_4xxx/adf_drv.c b/drivers/crypto/qat/qat_4xxx/adf_drv.c
index 2f21256..670a58b2 100644
--- a/drivers/crypto/qat/qat_4xxx/adf_drv.c
+++ b/drivers/crypto/qat/qat_4xxx/adf_drv.c
@@ -261,6 +261,7 @@  static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	hw_data->accel_capabilities_mask = hw_data->get_accel_cap(accel_dev);
 	if (!hw_data->accel_capabilities_mask) {
 		dev_err(&pdev->dev, "Failed to get capabilities mask.\n");
+		ret = -EINVAL;
 		goto out_err;
 	}