Skip to contentSkip to conversation

crypto: qat - fix a signedness bug in get_service_enabled()

PATCH In review Dan Carpenter 3 participants 3 messages Jan 11, 2022 – Jan 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: qat - fix a signedness bug in get_service_enabled()

The "ret" variable needs to be signed or there is an error message which will not be printed correctly.

Fixes 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")
---
 drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c +1 -1
index 6d10edc40aca..68d39c833332 100644
@@ -52,7 +52,7 @@ static const char *const dev_cfg_services[] = {
 static int get_service_enabled(struct adf_accel_dev *accel_dev)
 {
 	char services[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
-	u32 ret;
+	int ret;
 
 	ret = adf_cfg_get_param_value(accel_dev, ADF_GENERAL_SEC,
 				      ADF_SERVICES_ENABLED, services);
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

The "ret" variable needs to be signed or there is an error message which will not be printed correctly.

Fixes 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")

Thanks Dan.

@Herbert, there are 2 other (identical) patches in the list that fix the same issue:

    https://patchwork.kernel.org/project/linux-crypto/patch/YdWZm6QJAYbYTKAR@debian-BULLSEYE-live-builder-AMD64/
    https://patchwork.kernel.org/project/linux-crypto/patch/[email protected]/

Since none of them made into the pull request for 5.17, I'm fine with taking this one as it is the only one which contains the Fixes tag.

Regards,

Signature · 1 line
Giovanni
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 8 lines · Dan Carpenter

The "ret" variable needs to be signed or there is an error message which will not be printed correctly.

Fixes 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx")
---
 drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt