crypto: qat - fix error return code in adf_probe
authorWang Yufen <wangyufen@huawei.com>
Mon, 21 Nov 2022 11:27:34 +0000 (19:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:36 +0000 (13:32 +0100)
[ Upstream commit 31f81401e23fb88cc030cd586abd28740e6c8136 ]

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/qat/qat_4xxx/adf_drv.c

index 2f212561acc47b8c95e52c076ae7cc92980e06c0..670a58b25cb166a9479824af9dbe5462332482e4 100644 (file)
@@ -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;
        }