OSDN Git Service

crypto: qat - change return value in adf_cfg_key_val_get()
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Mon, 12 Oct 2020 20:38:43 +0000 (21:38 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Oct 2020 06:34:59 +0000 (17:34 +1100)
If a key is not found in the internal key value storage, return -ENODATA
instead of -1 that is treated as -EPERM and may confuse.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_cfg.c

index f2a29c7..575b6f0 100644 (file)
@@ -196,7 +196,7 @@ static int adf_cfg_key_val_get(struct adf_accel_dev *accel_dev,
                memcpy(val, keyval->val, ADF_CFG_MAX_VAL_LEN_IN_BYTES);
                return 0;
        }
-       return -1;
+       return -ENODATA;
 }
 
 /**