From: Tomasz Jozwiak Date: Mon, 22 Jan 2018 16:28:05 +0000 (+0100) Subject: crypto/qat: fix parameter type X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c202320775bb8094c41eaaff562a38cd6d7bce70;p=dpdk.git crypto/qat: fix parameter type This commit fixes right cast from qat_cipher_get_block_size function. This function can return -EFAULT in case of any error, and that value must be cast to int instead of uint8_t Fixes: d18ab45f7654 ("crypto/qat: support DOCSIS BPI mode") Cc: stable@dpdk.org Signed-off-by: Tomasz Jozwiak Acked-by: Fiona Trahe --- diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index f78c9b7ab2..61760b699a 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -819,7 +819,7 @@ static inline uint32_t qat_bpicipher_preprocess(struct qat_session *ctx, struct rte_crypto_op *op) { - uint8_t block_len = qat_cipher_get_block_size(ctx->qat_cipher_alg); + int block_len = qat_cipher_get_block_size(ctx->qat_cipher_alg); struct rte_crypto_sym_op *sym_op = op->sym; uint8_t last_block_len = block_len > 0 ? sym_op->cipher.data.length % block_len : 0; @@ -874,7 +874,7 @@ static inline uint32_t qat_bpicipher_postprocess(struct qat_session *ctx, struct rte_crypto_op *op) { - uint8_t block_len = qat_cipher_get_block_size(ctx->qat_cipher_alg); + int block_len = qat_cipher_get_block_size(ctx->qat_cipher_alg); struct rte_crypto_sym_op *sym_op = op->sym; uint8_t last_block_len = block_len > 0 ? sym_op->cipher.data.length % block_len : 0;