From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B809EA0487 for ; Fri, 5 Jul 2019 15:57:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4707B1BED2; Fri, 5 Jul 2019 15:57:52 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 52D6A1BEC9 for ; Fri, 5 Jul 2019 15:57:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2019 06:57:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,455,1557212400"; d="scan'208";a="167058790" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga003.jf.intel.com with ESMTP; 05 Jul 2019 06:57:49 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX154.ger.corp.intel.com (163.33.192.96) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 5 Jul 2019 14:57:48 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.88]) by irsmsx112.ger.corp.intel.com ([169.254.1.38]) with mapi id 14.03.0439.000; Fri, 5 Jul 2019 14:57:48 +0100 From: "Zhang, Roy Fan" To: Akhil Goyal , "dev@dpdk.org" Thread-Topic: [PATCH] crypto/mvsam: fix missed code change for mvsam Thread-Index: AQHVMzTmvZGJVFxI20qMGyLRY74pQqa789KAgAAYAPA= Date: Fri, 5 Jul 2019 13:57:47 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C604336613B3@IRSMSX101.ger.corp.intel.com> References: <20190705132349.7245-1-roy.fan.zhang@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODk0Y2E1YzAtYmFlZS00YWE1LTkyMGQtOWViNWM5Y2JmM2Q0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQyt5SXUyVGpiY2h3SlhqclBOeVwvRTZlV2p5SXdGbWNyaGV6Y3BuXC9jc0NQRXVGclVEZXpNbnJDT25RMVJmbUhCIn0= dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] crypto/mvsam: fix missed code change for mvsam 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 ; dev@dpdk.org > Subject: RE: [PATCH] crypto/mvsam: fix missed code change for mvsam >=20 > Hi Fan, >=20 > > ... > Extra blank spaces. Will change in v2.=20 >=20 ... > > - sess->sam_sess_params.cipher_key =3D aead_xform->aead.key.data; > > + aead_key =3D malloc(aead_xform->aead.key.length); > > + if (aead_key =3D=3D 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 =3D aead_key; > > sess->sam_sess_params.cipher_key_len =3D aead_xform- > > >aead.key.length; > > > > if (sess->sam_sess_params.cipher_mode =3D=3D 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 !=3D NULL) > > + free(mrvl_sess->sam_sess_params.cipher_key); > > + if (mrvl_sess->sam_sess_params.auth_key !=3D 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 aea= d key. So no matter it is cipher key or aead key the memory is freed here. Will fix the extra blank line in v2. >=20 >=20 > > return 0; > > } > > > > -- > > 2.14.5