From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org, gakhil@marvell.com
Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com,
Gagandeep Singh <g.singh@nxp.com>,
marcinx.smoczynski@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 04/15] crypto: fix raw process for multi-seg case
Date: Wed, 25 Aug 2021 12:44:59 +0530 [thread overview]
Message-ID: <20210825071510.7913-5-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20210825071510.7913-1-hemant.agrawal@nxp.com>
From: Gagandeep Singh <g.singh@nxp.com>
If no next segment available the “for” loop will fail and it still
returns i+1 i.e. 2, which is wrong as it has filled only 1 buffer.
Fixes: 7adf992fb9bf ("cryptodev: introduce CPU crypto API")
Cc: marcinx.smoczynski@intel.com
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
lib/cryptodev/rte_crypto_sym.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 978708845f..a48228a646 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -1003,6 +1003,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len,
vec[i].len = left;
vec[i].tot_len = mb->buf_len;
left = 0;
+ i++;
break;
}
@@ -1013,7 +1014,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len,
}
RTE_ASSERT(left == 0);
- return i + 1;
+ return i;
}
--
2.17.1
next parent reply other threads:[~2021-08-25 7:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210812071244.28799-1-hemant.agrawal@nxp.com>
[not found] ` <20210825071510.7913-1-hemant.agrawal@nxp.com>
2021-08-25 7:14 ` Hemant Agrawal [this message]
2021-09-06 18:38 ` [dpdk-stable] [EXT] " Akhil Goyal
[not found] ` <20210907075957.28848-1-hemant.agrawal@nxp.com>
2021-09-07 7:59 ` [dpdk-stable] [PATCH v2 " Hemant Agrawal
[not found] ` <20211013190032.2308-1-hemant.agrawal@nxp.com>
2021-10-13 19:00 ` [dpdk-stable] [PATCH v4 " Hemant Agrawal
2021-10-15 17:39 ` Ananyev, Konstantin
[not found] ` <20211017161651.9220-1-hemant.agrawal@nxp.com>
2021-10-17 16:16 ` [dpdk-stable] [PATCH v5 " Hemant Agrawal
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=20210825071510.7913-5-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=dev@dpdk.org \
--cc=g.singh@nxp.com \
--cc=gakhil@marvell.com \
--cc=konstantin.ananyev@intel.com \
--cc=marcinx.smoczynski@intel.com \
--cc=roy.fan.zhang@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).