From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 56CF0A2F18
	for <public@inbox.dpdk.org>; Thu,  3 Oct 2019 10:43:43 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 4777D1C02C;
	Thu,  3 Oct 2019 10:43:43 +0200 (CEST)
Received: from EUR03-DB5-obe.outbound.protection.outlook.com
 (mail-eopbgr40057.outbound.protection.outlook.com [40.107.4.57])
 by dpdk.org (Postfix) with ESMTP id 0ADC51BFF5;
 Thu,  3 Oct 2019 10:43:39 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kKawhWVUxEL2EsdDL1hRbbd4+AMAY4FVbaKQ1LjS7FjSTM5O3l8yz8+VAocx7TAE/z44s9EVKLBlvM/Gsd3bcwiSP9aFf2eM1SZcgzB+2A3zzwG1F/9P1LpAoFytAvHFCnnGw+VjmCpnAx0JGxkeUGrCXwOdpSAbngOlPC0GwsF9vLIvTPHrxlYCbfkPead8vwlxHYXSy+IXkFDNQzdJHO7CcS2pg1TipCSIt4+esICic3x4BtvVWzvLDfIKKRmbDf2aWdsit2CJ+yQj6QthFfES2u/jWaftxLu1YuPV6Pggbu4X/sPjDdymebCB7SOJpNvqTRr3Od6E2SA71JHjrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XdVGWk+ltW680wAJdD+j88SBXxeOPmzafDRy0EyPj38=;
 b=i20GuZfhnQ4WYPNDkoCriOf22IjJpjb1ykJdgdvGx/iReBVpcuXURIHnZrBEAA2qP9Npxt+4F7VJll6Wk1Cmc8Gv1ml8iXY/ERu1xKTAZOsrqzFYBdPoF4Ui1rXWE6srO6XHizhB4qtlOyh8BcDOKXvd600Y4HYStIUhbV11XVkcZTtNU1N8ixF3jD5FjthSY4PSgxHUPZi1844YDXf/TTGwUdJH2mu74BlZn9c27KIMczanNzZ0FFCNYnzIitWyPOOkdXGq9ksb+YQ8BORFv4Pydmf0mDPcNcGysOhRN5v0eumh4NEB2fhjyvTRZw9/FJdP1I7GwVckInUmziLbcA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; 
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XdVGWk+ltW680wAJdD+j88SBXxeOPmzafDRy0EyPj38=;
 b=PnDN4zmcexHbIUj3iMUNcbk61F3Z6hbRKMk+CslJqD4rpBdJbRNdOTAERAYBy52uNG4KRaL5CVfWLpEqYGY3Y89mgcLJeQ+7P+SrilBnNdgsFpgybnmU4nJ6D/3yssuLdVWD8hxjBSwWcEHFRgdYE2pgqmk1XxmNZQrTvDIDsGw=
Received: from VI1PR04MB4845.eurprd04.prod.outlook.com (20.177.49.14) by
 VI1PR04MB4335.eurprd04.prod.outlook.com (52.134.122.157) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2305.20; Thu, 3 Oct 2019 08:43:38 +0000
Received: from VI1PR04MB4845.eurprd04.prod.outlook.com
 ([fe80::fc3a:34f2:36f3:bea4]) by VI1PR04MB4845.eurprd04.prod.outlook.com
 ([fe80::fc3a:34f2:36f3:bea4%3]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019
 08:43:38 +0000
From: Sachin Saxena <sachin.saxena@nxp.com>
To: "Babu Radhakrishnan, AgalyaX" <agalyax.babu.radhakrishnan@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>
CC: "Pattan, Reshma" <reshma.pattan@intel.com>, Hemant Agrawal
 <hemant.agrawal@nxp.com>, "Parthasarathy, JananeeX M"
 <jananeex.m.parthasarathy@intel.com>, "stable@dpdk.org" <stable@dpdk.org>
Thread-Topic: [PATCH] bus/fslmc: fix for resource leak coverity issue
Thread-Index: AQHVZ6n/YM2SoP9j/kaoM+MIMDGptqckhvyAgCQ2OZA=
Date: Thu, 3 Oct 2019 08:43:38 +0000
Message-ID: <VI1PR04MB4845D9DDE06BE8F46925B752E39F0@VI1PR04MB4845.eurprd04.prod.outlook.com>
References: <1568100655-20010-1-git-send-email-agalyax.babu.radhakrishnan@intel.com>
 <27BEB63E27FEB2409936481F1E06A394D6E2FF@BGSMSX105.gar.corp.intel.com>
In-Reply-To: <27BEB63E27FEB2409936481F1E06A394D6E2FF@BGSMSX105.gar.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=sachin.saxena@nxp.com; 
x-originating-ip: [92.120.1.72]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 6fe5ed55-a0c9-4341-b05b-08d747ddc956
x-ms-office365-filtering-ht: Tenant
x-ms-traffictypediagnostic: VI1PR04MB4335:|VI1PR04MB4335:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <VI1PR04MB4335C1B3C8891947ADEB8583E39F0@VI1PR04MB4335.eurprd04.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7691;
x-forefront-prvs: 01792087B6
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(4636009)(376002)(39860400002)(396003)(366004)(136003)(346002)(13464003)(189003)(199004)(256004)(74316002)(486006)(4326008)(76116006)(86362001)(2501003)(9686003)(3846002)(186003)(476003)(14454004)(64756008)(26005)(305945005)(7736002)(44832011)(6116002)(55016002)(316002)(7696005)(8936002)(71200400001)(102836004)(6436002)(99286004)(71190400001)(2906002)(25786009)(66446008)(66556008)(66946007)(66476007)(478600001)(6246003)(66066001)(53546011)(446003)(76176011)(81166006)(81156014)(110136005)(11346002)(229853002)(54906003)(14444005)(5660300002)(52536014)(6506007)(8676002)(33656002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4335;
 H:VI1PR04MB4845.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; MX:1; A:1; 
received-spf: None (protection.outlook.com: nxp.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: F14YrP+eCRS8BtMtJ0F1ErpB3wE6KkBY9QbGFJQGuVdx2gGfKDYG9m2dDYa6CImEnVOM/10RBpMKScwJqdAaPDc5X3l3H4LvdQ2n0nuzre+5RqmFYMIxtrf1UQRx8bCb4m5XEs5Ww5RnQ6Nj2DUraKQMCbjLydsgN4jpzc2u4wy+ecQ4MTuwZdDleW9MkMQ2CdKSthRRABblKflRE0opNzdlMNQ+x5FqqRpsCgdglUhA0n5FZCLH1oQGValG9KbJkF9x/88fWj+tCMojsRTVg535a6sTf0lgGa2fm+XlKZKarX1LYnvxH8BmWv//sToWBcPbvzp44jY6ciZAIYlKkl6+mNf+zJGuKkV20K+mgHnKGVx4349eudRgfE0ubmzE1p+fTbbBN0tesRc+z2fk1urImX7rLZGVAIxWG174LB0=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6fe5ed55-a0c9-4341-b05b-08d747ddc956
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2019 08:43:38.6901 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: E0xfM1jCLiHyFIBM2evoBME0H0s9Yo20PtEs2RYasndoHwdKQXNt8Vv21D3t8BlKPKAi5vwjJ/jvUEztV9s0Ng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4335
Subject: Re: [dpdk-stable] [PATCH] bus/fslmc: fix for resource leak coverity
	issue
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>


> -----Original Message-----
> From: Babu Radhakrishnan, AgalyaX
> <agalyax.babu.radhakrishnan@intel.com>
> Sent: Tuesday, September 10, 2019 1:11 PM
> To: dev@dpdk.org
> Cc: Pattan, Reshma <reshma.pattan@intel.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>;
> Parthasarathy, JananeeX M <jananeex.m.parthasarathy@intel.com>;
> stable@dpdk.org
> Subject: RE: [PATCH] bus/fslmc: fix for resource leak coverity issue
> Importance: High
>=20
> Hi,
>=20
> > -----Original Message-----
> > From: Babu Radhakrishnan, AgalyaX
> > Sent: Tuesday, September 10, 2019 1:01 PM
> > To: dev@dpdk.org
> > Cc: Pattan, Reshma <reshma.pattan@intel.com>;
> hemant.agrawal@nxp.com;
> > sachin.saxena@nxp.com; Parthasarathy, JananeeX M
> > <jananeex.m.parthasarathy@intel.com>; Babu Radhakrishnan, AgalyaX
> > <agalyax.babu.radhakrishnan@intel.com>; stable@dpdk.org
> > Subject: [PATCH] bus/fslmc: fix for resource leak coverity issue
> >
> > From: Agalya Babu RadhaKrishnan
> <agalyax.babu.radhakrishnan@intel.com>
> >
> > 1 issue caught by 344967
> > Leaked_storage: Variable sep going out of scope leaks the storage it
> > points to.
> >
> > When 'sep' is not null and sep_exist is 0, 'sep' is freed before going
> > out of scope of the function irrespective of 'addr' exists or not.
> >
> > Coverity Issue: 344967
> > Fixes: e67a61614d0b ("bus/fslmc: support device iteration")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Agalya Babu RadhaKrishnan
> > <agalyax.babu.radhakrishnan@intel.com>
> > ---
>=20
> if (strncmp("dpni", sep, 4) &&
>             strncmp("dpseci", sep, 6) &&
>             strncmp("dpcon", sep, 5) &
>             .....
>=20
> We think validation of device name is done using AND operator instead it
> should be done by OR operator.
> Please confirm
[Sachin Saxena] The purpose of this logic to confirm that one of the device=
 name should match to supported list and as soon as one strncmp() matches t=
he string it will return 0 and the control comes out of IF condition.
So, existing logic is correct.