From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 52CB71B1FE; Mon, 14 Jan 2019 13:39:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 04:39:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,477,1539673200"; d="scan'208";a="109727485" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga008.jf.intel.com with ESMTP; 14 Jan 2019 04:39:04 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 14 Jan 2019 12:39:02 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.116]) by irsmsx155.ger.corp.intel.com ([169.254.14.157]) with mapi id 14.03.0415.000; Mon, 14 Jan 2019 12:39:02 +0000 From: "Ananyev, Konstantin" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Yang, Qiming" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib: add warning for NULL pointer Thread-Index: AQHUjFM5NZ3zuvIUPUyoCJn/4UMjGaWu8qjw Date: Mon, 14 Jan 2019 12:39:02 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258010D903A01@irsmsx105.ger.corp.intel.com> References: <20181205115531.17073-1-qiming.yang@intel.com> In-Reply-To: <20181205115531.17073-1-qiming.yang@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTQ1Y2VkYzktNmRlMC00MTIyLWI0ZDgtODc1Y2Y0YTJjOTkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiREhzUXFYXC9paHY4WEpjSnBsTlNHM3BFSjh0Y1wvZzhTdlwvMGtSS3dpRzhOOENHUlBDR05KXC9aa1wvNStWU0dLc29zIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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] lib: add warning for NULL pointer 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: Mon, 14 Jan 2019 12:39:08 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang > Sent: Wednesday, December 5, 2018 11:56 AM > To: dev@dpdk.org > Cc: Yang, Qiming ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] lib: add warning for NULL pointer >=20 > May return NULL when manage tries for packet in acl library. So > this patch added warning for the NULL pointer return. >=20 > Fixes: 074f54ad03ee ("acl: fix build and runtime for default target") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Yang > --- > lib/librte_acl/acl_run.h | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h > index bf7842d..6c718c0 100644 > --- a/lib/librte_acl/acl_run.h > +++ b/lib/librte_acl/acl_run.h > @@ -143,6 +143,9 @@ acl_start_next_trie(struct acl_flow_data *flows, stru= ct parms *parms, int n, > flows->num_packets * flows->categories); > } >=20 > + if (flows->last_cmplt =3D=3D NULL) > + RTE_LOG(WARNING, MALLOC, "packet tries allocate failed"); > + alloc_completion() should never retrun NULL (unless something is totally broken). So no need to handle such situation. If you desire - feel free to add RTE_ASSERT(flows->last_cmplt !=3D NULL) here. Konstantin > /* set completion parameters and starting index for this slot */ > parms[n].cmplt =3D flows->last_cmplt; > transition =3D > -- > 2.9.5