Fix invalid value that is returned when asymmetric crypto
or compression service is selected.

Fixes: 8f393c4ffdc1 ("common/qat: support GEN4 devices")

Signed-off-by: Arek Kusztal <arkadiuszx.kusz...@intel.com>
---
 drivers/compress/qat/qat_comp_pmd.c | 2 +-
 drivers/crypto/qat/qat_asym_pmd.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/compress/qat/qat_comp_pmd.c 
b/drivers/compress/qat/qat_comp_pmd.c
index cfdcb6b3d1..92a2285b53 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -713,7 +713,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev,
 
        if (qat_pci_dev->qat_dev_gen == QAT_GEN4) {
                QAT_LOG(ERR, "Compression PMD not supported on QAT 4xxx");
-               return 0;
+               return -(EFAULT);
        }
        snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "comp");
diff --git a/drivers/crypto/qat/qat_asym_pmd.c 
b/drivers/crypto/qat/qat_asym_pmd.c
index 56ccca36d1..d4680c3847 100644
--- a/drivers/crypto/qat/qat_asym_pmd.c
+++ b/drivers/crypto/qat/qat_asym_pmd.c
@@ -253,7 +253,7 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev,
 
        if (qat_pci_dev->qat_dev_gen == QAT_GEN4) {
                QAT_LOG(ERR, "Asymmetric crypto PMD not supported on QAT 4xxx");
-               return 0;
+               return -(EFAULT);
        }
        snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "asym");
-- 
2.30.2

Reply via email to