crypto: qat - validate service in rate limiting sysfs api
authorSuman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>
Thu, 10 Jul 2025 13:33:40 +0000 (14:33 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Jul 2025 10:52:00 +0000 (20:52 +1000)
commit63fa7c4dc0ea965d0a17fdbf51e5b421f61000fe
tree9b11cb151bbdcfed2dc2b9690ecd2f883e3542cf
parentf0ae287c50455f7be0d8dd45a803d403c7aa4d2e
crypto: qat - validate service in rate limiting sysfs api

The sysfs interface 'qat_rl/srv' currently allows all valid services,
even if a service is not configured for the device. This leads to a failure
when attempting to add the SLA using 'qat_rl/sla_op'.

Add a check using is_service_enabled() to ensure the requested service is
enabled. If not, return -EINVAL to prevent invalid configurations.

Signed-off-by: Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/intel/qat/qat_common/adf_rl.c
drivers/crypto/intel/qat/qat_common/adf_rl.h
drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c