> -----Original Message-----
> From: dev [mailto:[email protected]] On Behalf Of
> [email protected]
> Sent: Wednesday, April 19, 2017 4:38 PM
> To: [email protected]
> Cc: Doherty, Declan; Mcnamara, John; [email protected]
> Subject: [dpdk-dev] [PATCH v8 11/13] crypto/dpaa2_sec: add crypto
> operation support
>
> From: Akhil Goyal <[email protected]>
>
> Signed-off-by: Akhil Goyal <[email protected]>
> Signed-off-by: Hemant Agrawal <[email protected]>
> ---
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 1236
> +++++++++++++++++++++++++++
> drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h | 143 ++++
> 2 files changed, 1379 insertions(+)
>
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index e0e8cfb..7c497c0 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
...
> +/** Clear the memory of session so it doesn't leave key material behind */
> +static void
> +dpaa2_sec_session_clear(struct rte_cryptodev *dev __rte_unused, void
> *sess)
> +{
> + PMD_INIT_FUNC_TRACE();
> + dpaa2_sec_session *s = (dpaa2_sec_session *)sess;
> +
> + if (s) {
> + if (s->ctxt)
> + rte_free(s->ctxt);
> + if (&s->cipher_key)
> + rte_free(s->cipher_key.data);
> + if (&s->auth_key)
> + rte_free(s->auth_key.data);
No need for these checks, rte_free can handle NULL pointers
(assuming that the structure is initialized to all 0s when created, which looks
like it is happening below).
Unless there are other changes required (I am currently reviewing the
patchset), I can make this and
the change from the other email myself, when applying the patchset.
Thanks,
Pablo