From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1CA9A532C for ; Mon, 13 Jun 2016 13:20:22 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 13 Jun 2016 04:20:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="1000802090" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2016 04:20:21 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.183]) by IRSMSX152.ger.corp.intel.com ([169.254.6.247]) with mapi id 14.03.0248.002; Mon, 13 Jun 2016 12:20:20 +0100 From: "Dumitrescu, Cristian" To: "Kerlin, MarcinX" , "dev@dpdk.org" CC: "Azarewicz, PiotrX T" Thread-Topic: [PATCH 1/1] ip_pipeline: fix null pointer dereference Thread-Index: AQHRxU0WzY082nnC+kqru0JR+P/RA5/nP0BQ Date: Mon, 13 Jun 2016 11:20:20 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647A0255F@IRSMSX108.ger.corp.intel.com> References: <1465810549-19097-1-git-send-email-marcinx.kerlin@intel.com> In-Reply-To: <1465810549-19097-1-git-send-email-marcinx.kerlin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2RmMDYwYjAtY2MwMC00NTBmLTk5NTctMTY5N2U0YWE5NmYzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InhpT1BWb1lLSTFxVTNlaGJNeU9QWUw1NnFSUGxCZFNrWk1MdVNRakIxUTA9In0= x-ctpclassification: CTP_IC 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/1] ip_pipeline: fix null pointer dereference X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 11:20:23 -0000 > -----Original Message----- > From: Kerlin, MarcinX > Sent: Monday, June 13, 2016 10:36 AM > To: dev@dpdk.org > Cc: Azarewicz, PiotrX T ; Dumitrescu, Crist= ian > ; Kerlin, MarcinX > > Subject: [PATCH 1/1] ip_pipeline: fix null pointer dereference >=20 > Return value of function app_pipeline_type_find is not checking before > dereference. Fix this problem by adding checking condition. >=20 > Coverity issue: 127196 > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding > dynamically") >=20 > Signed-off-by: Marcin Kerlin > --- > examples/ip_pipeline/thread_fe.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/examples/ip_pipeline/thread_fe.c > b/examples/ip_pipeline/thread_fe.c > index d1b72b4..6c547ca 100644 > --- a/examples/ip_pipeline/thread_fe.c > +++ b/examples/ip_pipeline/thread_fe.c > @@ -81,6 +81,9 @@ app_pipeline_enable(struct app_params *app, > p_params =3D &app->pipeline_params[pipeline_id]; > p_type =3D app_pipeline_type_find(app, p_params->type); >=20 > + if (p_type =3D=3D NULL) > + return -1; > + > if (p->enabled =3D=3D 1) > return -1; >=20 > -- > 1.9.1 Hi Marcin, Checking p_type at this point is not required, as we already validated the = pipeline settings (including the pipeline type) as part of the init code. But since this code is harmless I am acking this patch just to avoid having= the same discussion about this Coverity false positive issue again. Regards, Cristian Acked-by: Cristian Dumitrescu