From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 132099B57 for ; Tue, 1 Aug 2017 09:13:03 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2017 00:13:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,305,1498546800"; d="scan'208";a="884949117" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by FMSMGA003.fm.intel.com with ESMTP; 01 Aug 2017 00:09:52 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.133]) by IRSMSX104.ger.corp.intel.com ([169.254.5.26]) with mapi id 14.03.0319.002; Tue, 1 Aug 2017 08:09:51 +0100 From: "De Lara Guarch, Pablo" To: Thomas Monjalon CC: "dev@dpdk.org" , "Gonzalez Monroy, Sergio" , "Doherty, Declan" Thread-Topic: [dpdk-dev] [PATCH] cryptodev: fix NULL pointer dereference Thread-Index: AQHTCegP/2KxTl+sSEyvWPkl6rtb86JtzbQAgAAvYYCAADvLAA== Date: Tue, 1 Aug 2017 07:09:51 +0000 Message-ID: References: <20170731023050.28956-1-pablo.de.lara.guarch@intel.com> <8040895.veDesW7eHG@xps> In-Reply-To: <8040895.veDesW7eHG@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix NULL pointer dereference 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: Tue, 01 Aug 2017 07:13:04 -0000 Hi Thomas, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Monday, July 31, 2017 4:23 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Gonzalez Monroy, Sergio > ; Doherty, Declan > > Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix NULL pointer dereference >=20 > 31/07/2017 14:32, Sergio Gonzalez Monroy: > > On 31/07/2017 03:30, Pablo de Lara wrote: > > > --- a/lib/librte_cryptodev/rte_cryptodev.c > > > +++ b/lib/librte_cryptodev/rte_cryptodev.c > > > @@ -1404,6 +1404,12 @@ rte_cryptodev_allocate_driver(const struct > rte_driver *drv) > > > struct cryptodev_driver *driver; > > > > > > driver =3D malloc(sizeof(*driver)); > > > + > > > + if (driver =3D=3D NULL) > > > + rte_exit(EXIT_FAILURE, > > > + "Could not allocate memory for crypto driver %u\n", > > > + nb_drivers); > > > + > > > driver->driver =3D drv; > > > driver->id =3D nb_drivers; > > > > > > > Acked-by: Sergio Gonzalez Monroy >=20 > NACK rte_exit/rte_panic in libraries. I have sent a v2 that allocates statically the structure, instead of calling malloc, so no rte_exit is required. Thanks, Pablo