DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>
To: Akhil Goyal <akhil.goyal@nxp.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] crypto/mvsam: fix missed code change for mvsam
Date: Fri, 5 Jul 2019 13:57:47 +0000	[thread overview]
Message-ID: <9F7182E3F746AB4EA17801C148F3C604336613B3@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <VE1PR04MB6639678BF55C0BDDDB854447E6F50@VE1PR04MB6639.eurprd04.prod.outlook.com>

Hi Akhil,

Thanks for the review, comments inline.

Regards,
Fan

> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Friday, July 5, 2019 2:28 PM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>; dev@dpdk.org
> Subject: RE: [PATCH] crypto/mvsam: fix missed code change for mvsam
> 
> Hi Fan,
> 
> >
...
> Extra blank spaces.

Will change in v2. 

> 

...

> > -	sess->sam_sess_params.cipher_key = aead_xform->aead.key.data;
> > +	aead_key = malloc(aead_xform->aead.key.length);
> > +	if (aead_key == NULL) {
> > +		MRVL_LOG(ERR, "Insufficient memory!");
> > +		return -ENOMEM;
> > +	}
> > +
> > +	memcpy(aead_key, aead_xform->aead.key.data,
> > +			aead_xform->aead.key.length);
> > +
> > +	sess->sam_sess_params.cipher_key = aead_key;
> >  	sess->sam_sess_params.cipher_key_len = aead_xform-
> > >aead.key.length;
> >
> >  	if (sess->sam_sess_params.cipher_mode == SAM_CIPHER_GCM)
> diff --git
> > a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> > b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> > index f6bf2cd4c..b334c7694 100644
> > --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> > +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> > @@ -751,6 +751,8 @@


> >
> > +	/* free the keys memory allocated for session creation */
> > +	if (mrvl_sess->sam_sess_params.cipher_key != NULL)
> > +		free(mrvl_sess->sam_sess_params.cipher_key);
> > +	if (mrvl_sess->sam_sess_params.auth_key != NULL)
> > +		free(mrvl_sess->sam_sess_params.auth_key);
> > +
> > +
> Extra blank and missing the aead key free.

During the session config the driver used cipher_key field to store the aead key. So no matter it is cipher key or aead key the memory is freed here.
Will fix the extra blank line in v2.

> 
> 
> >  	return 0;
> >  }
> >
> > --
> > 2.14.5


  reply	other threads:[~2019-07-05 13:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 13:23 Fan Zhang
2019-07-05 13:28 ` Akhil Goyal
2019-07-05 13:57   ` Zhang, Roy Fan [this message]
2019-07-05 13:31 ` Akhil Goyal
2019-07-07  5:41   ` Liron Himi
2019-07-08 10:26     ` Thomas Monjalon
2019-07-08 10:31       ` Akhil Goyal
2019-07-08 15:22       ` Thomas Monjalon
2019-07-12  6:31         ` Akhil Goyal
2019-07-15 12:45           ` Akhil Goyal

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=9F7182E3F746AB4EA17801C148F3C604336613B3@IRSMSX101.ger.corp.intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@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).