From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710066.outbound.protection.outlook.com [40.107.71.66]) by dpdk.org (Postfix) with ESMTP id A928C4CB3; Tue, 30 Oct 2018 15:00:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/hDcVKS20y+MZ5jxyijnx5vh9NDqnJKk8fqo+9LaQnI=; b=fDI46OGyBxmKVpbGtfE5EUBLP1Y6ye2+LWCEoknB2G+8YYqn0bCC5WNKdzoUWrCcOuHdWZOsbTThWNWf6F5BW4xJZs7D6eARpRvR6rsv01DxgVCwExtAje5mgo8DEOI6RtmjkCWBaB9z8Jc26LvMWjfI1bqpcey9Bk64wLIdOOA= Received: from SN6PR07MB5152.namprd07.prod.outlook.com (52.135.101.33) by SN6PR07MB5552.namprd07.prod.outlook.com (20.177.251.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.24; Tue, 30 Oct 2018 14:00:13 +0000 Received: from SN6PR07MB5152.namprd07.prod.outlook.com ([fe80::49cb:b2a:974:2211]) by SN6PR07MB5152.namprd07.prod.outlook.com ([fe80::49cb:b2a:974:2211%4]) with mapi id 15.20.1273.027; Tue, 30 Oct 2018 14:00:13 +0000 From: "Verma, Shally" To: Fiona Trahe , "dev@dpdk.org" CC: "thomas@monjalon.net" , "akhil.goyal@nxp.com" , "tomaszx.jozwiak@intel.com" , "sabyasg@hpe.com" , "stable@dpdk.org" Thread-Topic: [PATCH v2] lib/compressdev: Fix logic error on op allocation Thread-Index: AQHUbY4T8/JcXkgagUWjFdFmbtXj8qU31osw Date: Tue, 30 Oct 2018 14:00:13 +0000 Message-ID: References: <1540599469-21696-1-git-send-email-fiona.trahe@intel.com> <1540600987-8101-1-git-send-email-fiona.trahe@intel.com> In-Reply-To: <1540600987-8101-1-git-send-email-fiona.trahe@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=Shally.Verma@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5552; 6:SE6h7Igrg70bGZqZj5j2LL/A7lxmu9WDPnTAP547Lw+Xn+x7iHihN04B4l4+RjlD+Unz7MkKEuVZT7VKHrie/5DWIZgPfDYRdIYdY9bQCYenzVkosbxfI9MFGwuwuhPPbuAlFKGzw0V5zS0E8reoAdu6kGZ1e1L4o7TtG/tQHgs7MaPqkMisP/X7lWQVHYhrddgZnuK28eyyUGjuRuq/+sD4glatbVXF4YGtWnPdZ9/FVBXEXnHNz6VVv7/cQKLk47PAniRQT8eg9BwvwZw+Rzdk0XgdFzDwHDYKd7BbV9DMToBOpEFV0snCZ2E6HyvREAw5SmsMFIlneCZV7IJiteluFvAYym0UhhgqNQumWD4Xa33NSlxW1d2YScp9aob1ffKGfe0FNGgl12qan+wXyogFJ2UgBaJRZrlEqXOvhI/1dAkpxQ4J/mc1NNhoJrSPx4ywD24aH9zwCk4WNaBTWA==; 5:thUSdmioMrPUMUdm1qLq24frH/BwEIJW92zxKD/v4H8pI5BVpDfR46rXvewtoxoZsTN+y3F6GTRFfFd2l91gVNC2c64ZNrte8SOKyxmQYUGm7uctOtXMCps0cZfs3LaYsSXDpBrV+h13dK3qDYlgOMHOMVHqatAgh751pnqzsnM=; 7:0pba97n7yvYxUQSkS3W/Uy9QeJWzyS7VPBuIVU0fqylxFxjNz51FsI5NmjFqV6wItt2L4HTrYOSs/60F2dBixgTvFU/fnJoSJVWUskOKg8CKn6AP5G5Qi+9Xc5opwc2s2AzWhPpZ9LIOLaoG837+ww== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c845efd3-110a-4997-f2e0-08d63e70035e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5552; x-ms-traffictypediagnostic: SN6PR07MB5552: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(228905959029699)(222181515654134)(227479698468861); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5552; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5552; x-forefront-prvs: 08417837C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39850400004)(346002)(136003)(366004)(396003)(13464003)(199004)(189003)(186003)(105586002)(4326008)(33656002)(256004)(5250100002)(2501003)(316002)(102836004)(25786009)(66066001)(55016002)(2906002)(106356001)(6436002)(7696005)(6506007)(54906003)(76176011)(14454004)(81166006)(26005)(55236004)(68736007)(72206003)(2900100001)(53936002)(9686003)(99286004)(3846002)(6246003)(71190400001)(8676002)(97736004)(81156014)(6116002)(86362001)(74316002)(486006)(8936002)(110136005)(476003)(229853002)(5660300001)(11346002)(71200400001)(446003)(478600001)(7736002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5552; H:SN6PR07MB5152.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: W9FcZRU3XUnI19n1hViUwNz+VjnbJ4wQNde9W17zsm7Kbn/qRPkET5SyygYe4+kbL6NSMy7qc7d4GH+gFH1LX9Dryoi3mGxtOZ3MPu6r3cro3hNGkdDudQPrmNRSfknR8uu2T39NrCpec3ajWgxu9Wb/Akaz5mwN1XBr7fPm2t3PzrUH5xYaKENhKhYGGBXe5ojd47yyQZf8bpWyPi8YuogT0EsdRPILBiMrsNXNa87xR3+NqTquoLxhru3r7Y6NNHYir5Ut3wkADvqMxI/Q6W7+QUg6IJaMpVHcW+pOam9ESB+Aaj66Wwj+jXkj6tX4+XoNWCrl7nT4hgcPiNIRMUwFrKrX2HflxbI/JHmIDIs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: c845efd3-110a-4997-f2e0-08d63e70035e X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2018 14:00:13.1335 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5552 Subject: Re: [dpdk-stable] [PATCH v2] lib/compressdev: Fix logic error on op allocation 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: Tue, 30 Oct 2018 14:00:16 -0000 >-----Original Message----- >From: Fiona Trahe >Sent: 27 October 2018 06:13 >To: dev@dpdk.org >Cc: thomas@monjalon.net; akhil.goyal@nxp.com; tomaszx.jozwiak@intel.com; s= abyasg@hpe.com; Verma, Shally >; Fiona Trahe ; stable@dpd= k.org >Subject: [PATCH v2] lib/compressdev: Fix logic error on op allocation > >External Email > >Fixed bad logic in rte_comp_op_alloc() checking return >value from rte_comp_op_raw_bulk_alloc(). This >could have resulted in a seg-fault in error case. >Made rte_comp_ob_bulk_alloc() code consistent >with rte_comp_op_alloc(). > > >Fixes: 96086db5a369 ("compressdev: add operation management") >Cc: stable@dpdk.org > >Reported-by: Sabyasachi Sengupta >Signed-off-by: Fiona Trahe >--- >v2 change: > - added Reported-by tag > > lib/librte_compressdev/rte_comp.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/lib/librte_compressdev/rte_comp.c b/lib/librte_compressdev/rt= e_comp.c >index c663be5..4634c12 100644 >--- a/lib/librte_compressdev/rte_comp.c >+++ b/lib/librte_compressdev/rte_comp.c >@@ -174,7 +174,7 @@ rte_comp_op_alloc(struct rte_mempool *mempool) > int retval; > > retval =3D rte_comp_op_raw_bulk_alloc(mempool, &op, 1); >- if (unlikely(retval < 0)) >+ if (unlikely(retval !=3D 1)) > return NULL; > > rte_comp_op_reset(op); >@@ -186,12 +186,12 @@ int __rte_experimental > rte_comp_op_bulk_alloc(struct rte_mempool *mempool, > struct rte_comp_op **ops, uint16_t nb_ops) > { >- int ret; >+ int retval; > uint16_t i; > >- ret =3D rte_comp_op_raw_bulk_alloc(mempool, ops, nb_ops); >- if (unlikely(ret < nb_ops)) >- return ret; >+ retval =3D rte_comp_op_raw_bulk_alloc(mempool, ops, nb_ops); >+ if (unlikely(retval !=3D nb_ops)) >+ return 0; > > for (i =3D 0; i < nb_ops; i++) > rte_comp_op_reset(ops[i]); >-- >2.7.4 Acked-by: Shally Verma