From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 583E76CCC; Fri, 27 Apr 2018 13:36:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 04:36:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,335,1520924400"; d="scan'208";a="41071997" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga002.fm.intel.com with ESMTP; 27 Apr 2018 04:36:14 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 27 Apr 2018 12:36:13 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.155]) by irsmsx155.ger.corp.intel.com ([169.254.14.108]) with mapi id 14.03.0319.002; Fri, 27 Apr 2018 12:36:13 +0100 From: "De Lara Guarch, Pablo" To: Akhil Goyal , "Zhang, Roy Fan" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/2] crypto/scheduler: set null pointer after freeing Thread-Index: AQHT3XDDuWJwf9kImE+OP7/nB7na46QUPPcAgAASedA= Date: Fri, 27 Apr 2018 11:36:12 +0000 Message-ID: References: <20180426150950.7568-1-pablo.de.lara.guarch@intel.com> <5e2f48d7-c451-c550-5ddc-70263a278e2f@nxp.com> In-Reply-To: <5e2f48d7-c451-c550-5ddc-70263a278e2f@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2RlZjkyNzUtZGZmNC00YmI1LTgyMjEtNDFmYjY1MmNlZjY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InRVa0NoYVdaY2RJazdiNFliR1JsVFp4RVFuWXRNMHFZYnhkWUx0WkhnMEU9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] crypto/scheduler: set null pointer after freeing 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: Fri, 27 Apr 2018 11:36:17 -0000 Hi Akhil, > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Friday, April 27, 2018 9:47 AM > To: De Lara Guarch, Pablo ; Zhang, Roy Fa= n > > Cc: dev@dpdk.org; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 1/2] crypto/scheduler: set null pointer af= ter > freeing >=20 > Hi Pablo, >=20 > On 4/26/2018 8:39 PM, Pablo de Lara wrote: > > When freeing memory, pointers should be set to NULL, to avoid memory > > corruption/segmentation faults. >=20 > Shouldn't this be handled in the rte_free itself. A lot of other driver a= re also not > setting null after rte_free. > This would require change at a lot of places if this is not handled in rt= e_free. >=20 The glibc function "free" works the same way. Users are responsible for setting to NULL these pointers (because sometimes, it is not necessary to d= o such thing). Anyway, in case we still wanted to change it, we would need to pass a point= er to a pointer in rte_free, which would imply an API breakage. Thanks, Pablo > Thanks, > Akhil