From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6791D1B21F; Mon, 2 Oct 2017 16:13:50 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 07:13:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="134334993" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga004.jf.intel.com with ESMTP; 02 Oct 2017 07:13:48 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 2 Oct 2017 15:13:47 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by irsmsx155.ger.corp.intel.com ([169.254.14.169]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 15:13:47 +0100 From: "Jastrzebski, MichalX K" To: "Kozak, KubaX" , "Ananyev, Konstantin" CC: "dev@dpdk.org" , "Kozak, KubaX" , "stable@dpdk.org" , "Jain, Deepak K" Thread-Topic: [dpdk-dev] [PATCH] acl: fix unchecked return value Thread-Index: AQHTMffozoxag95fiEiAf9LkvuU8oqLQrSVQ Date: Mon, 2 Oct 2017 14:13:45 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C40F96@IRSMSX109.ger.corp.intel.com> References: <1505901708-526-1-git-send-email-kubax.kozak@intel.com> In-Reply-To: <1505901708-526-1-git-send-email-kubax.kozak@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjk3MjMzNDEtMzJhZi00ZGEwLWJjZTctYjFhY2YzMjUzOTllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlZaTERXWG1oUERaWENPU1wvc0wyY09qXC9ITXZPalJuMmxqUXdya01ka2VXVT0ifQ== 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-stable] [dpdk-dev] [PATCH] acl: fix unchecked return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 14:13:50 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kuba Kozak > Sent: Wednesday, September 20, 2017 12:02 PM > To: Ananyev, Konstantin > Cc: dev@dpdk.org; Kozak, KubaX ; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH] acl: fix unchecked return value >=20 > Add return value check and error handling for fseek call. >=20 > Coverity issue: 143435 > Fixes: 361b2e9559fc ("acl: new sample l3fwd-acl") > Cc: konstantin.ananyev@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Kuba Kozak > --- > examples/l3fwd-acl/main.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c > index 8eff4de..708e9eb 100644 > --- a/examples/l3fwd-acl/main.c > +++ b/examples/l3fwd-acl/main.c > @@ -1026,6 +1026,7 @@ add_rules(const char *rule_path, > char buff[LINE_MAX]; > FILE *fh =3D fopen(rule_path, "rb"); > unsigned int i =3D 0; > + int val; >=20 > if (fh =3D=3D NULL) > rte_exit(EXIT_FAILURE, "%s: Open %s failed\n", __func__, > @@ -1042,7 +1043,11 @@ add_rules(const char *rule_path, > rte_exit(EXIT_FAILURE, "Not find any route entries in %s!\n", > rule_path); >=20 > - fseek(fh, 0, SEEK_SET); > + val =3D fseek(fh, 0, SEEK_SET); > + if (val < 0) { > + rte_exit(EXIT_FAILURE, "%s: File seek operation failed\n", > + __func__); > + } >=20 > acl_rules =3D calloc(acl_num, rule_size); >=20 > -- > 2.7.4 Hi Konstantin, I would like to ask for a feedback regarding proposed fix.=20 If everything is ok with it, please send acked-by.=20 Best regards Michal.