From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 070D77D30; Mon, 22 Jan 2018 17:28:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 08:28:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,397,1511856000"; d="scan'208";a="11668127" Received: from tjozwiax-wtg1.ger.corp.intel.com (HELO tojo-VirtualBox.ir.intel.com) ([10.237.220.111]) by orsmga007.jf.intel.com with ESMTP; 22 Jan 2018 08:28:36 -0800 From: Tomasz Jozwiak To: Fiona.trahe@intel.com, Deepak.k.jain@intel.com, john.griffin@intel.com Cc: dev@dpdk.org, Tomasz Jozwiak , stable@dpdk.org Date: Mon, 22 Jan 2018 17:28:05 +0100 Message-Id: <1516638485-10139-4-git-send-email-tomaszx.jozwiak@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516638485-10139-1-git-send-email-tomaszx.jozwiak@intel.com> References: <1516024409-7659-1-git-send-email-tomaszx.jozwiak@intel.com> <1516638485-10139-1-git-send-email-tomaszx.jozwiak@intel.com> Subject: [dpdk-dev] [PATCH v2 3/3] crypto/qat: fix parameter type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2018 16:28:40 -0000 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 --- 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