From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
To: Fiona.trahe@intel.com, Deepak.k.jain@intel.com, john.griffin@intel.com
Cc: dev@dpdk.org, Tomasz Jozwiak <tomaszx.jozwiak@intel.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 3/3] crypto/qat: fix parameter type
Date: Mon, 22 Jan 2018 17:28:05 +0100 [thread overview]
Message-ID: <1516638485-10139-4-git-send-email-tomaszx.jozwiak@intel.com> (raw)
In-Reply-To: <1516638485-10139-1-git-send-email-tomaszx.jozwiak@intel.com>
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 <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/qat/qat_crypto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 7b577b9..e411ae5 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -848,7 +848,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;
@@ -903,7 +903,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;
--
2.7.4
prev parent reply other threads:[~2018-01-22 16:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1516024409-7659-1-git-send-email-tomaszx.jozwiak@intel.com>
[not found] ` <1516638485-10139-1-git-send-email-tomaszx.jozwiak@intel.com>
2018-01-22 16:28 ` [dpdk-stable] [PATCH v2 1/3] crypto/qat: fix out-of-bounds compiler error Tomasz Jozwiak
2018-01-22 16:28 ` [dpdk-stable] [PATCH v2 2/3] crypto/qat: fix typo in error message Tomasz Jozwiak
2018-01-22 16:28 ` Tomasz Jozwiak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516638485-10139-4-git-send-email-tomaszx.jozwiak@intel.com \
--to=tomaszx.jozwiak@intel.com \
--cc=Deepak.k.jain@intel.com \
--cc=Fiona.trahe@intel.com \
--cc=dev@dpdk.org \
--cc=john.griffin@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).