From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1156CA0350; Sun, 10 May 2020 07:53:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 77B331D5DC; Sun, 10 May 2020 07:53:34 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2073.outbound.protection.outlook.com [40.107.22.73]) by dpdk.org (Postfix) with ESMTP id 1B2091D575; Sun, 10 May 2020 07:53:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IPlZFxXOUeGtsmlburOmPbkZSMfNmHwZQW7me5rJ77035cUt7E5v3ImYXbnygaHtfXG52435RmP2UwS6Wik7vG0o4EUOrVa+n6yOl4FplezXjo2Pm3z80sDScLKusToBL/Xlw7kEfB0C1SCwqG9h8wciMoUiqV8uXuvYcoQLIooGVMJr3gfPkf4aF3H2FhPczJqYTHQrHePRWVnCJfhqveNfceNkmliB66xz5XX8vOGoEX+9t+n80ZofabqbxFNFa3wjjebJ6byNmCq1Odl8cqdpTSVvY33ie3gyvv7tOeBdH9bIQGxxAF13WbrwM0g7B8xYYAgrsYsCro8IEHxOSw== 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=/ZYeSOJOyoehKReONTpa1rv65bG/AEtprf/o8oU8Gjs=; b=YOGINqY7WdLeGttlAN9vQF0TGewn50n44iSULvvwPVBGNwc05SkUJiYjpbaxq8zlBV9ICe9IZOa8pNmgdT+zbCKcDFvygrsxh+2FSpGYK4TC87iuqaeFoZdvaMuFT6BxeHA+on8ElLXCZ2SXVmER6+JKDYu0ALkyRFfTFrVcf4EvQAGVnxSBwpU9DXV+Blbu22r4XUqvcWEhAkh8Jm7DZcqxYXIWOXVtE4yKbfdhHKh31Bh7DRbpwS1/qJNV/Ro1OWPoi7TRg5UWBTlgl9rsOFijAu3AecJK3n7n4EKnmHEG/66ENXhdd9PQ4c7pvT2CIue7MhozVEA/ZWoOtA9jpQ== 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=/ZYeSOJOyoehKReONTpa1rv65bG/AEtprf/o8oU8Gjs=; b=DZa/O11j53x45iECarrS7aKoovjG8FqXRK3IhmAve5vtVyHNjoEI5syr8sRNaT0+mQDIwnY5LvMDUDma8nU17yG2T2bmJ4Zz5zRfUFrFJ090Go/pNcqyz/xIVq71G7soajUMFiM5bqe66WtDcEW4E8Jt8IxC39vj8wfOO8Z0a4Y= Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VI1SPR01MB0354.eurprd04.prod.outlook.com (2603:10a6:803:a3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Sun, 10 May 2020 05:53:31 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::dd6:d975:588f:1c1c]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::dd6:d975:588f:1c1c%3]) with mapi id 15.20.2979.033; Sun, 10 May 2020 05:53:31 +0000 From: Gagandeep Singh To: wangyunjian , "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , "jerry.lilijun@huawei.com" , "xudingke@huawei.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] crypto/caam_jr: fix wrong check of fd Thread-Index: AQHWG8rI44mHCdfRd0u9BduxVJOHeaigGinAgADLE7A= Date: Sun, 10 May 2020 05:53:31 +0000 Message-ID: References: <1587906052-1548-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [106.211.90.32] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 591d3813-f1e7-43a7-15f6-08d7f4a67869 x-ms-traffictypediagnostic: VI1SPR01MB0354:|VI1SPR01MB0354: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 039975700A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yUvGq7hBUcC37yMxLBd3ngJto//ke8DXbclAUF0PSMr9rijdaeYrjLJnEwMcoA111PSeK3BG/5uTW2qR881mePms/zKi/yjE+NUqStUFHNmnmlsUV0siU+IFjiifTR6TMiUEybALvroZhIHM+HTOkfe2KqCiiiJ+CUG/+WDErxFU1odLvdW9to3EvBGlV9Z7rLmBIzRfwRfyRJKXuVRdDOgtJjokedYVV3S0CEybrKDwiTz8M7yFUHPQehqXITcRNkgEc3dqRKys/Grvmv4fWf5raStmblpob534g2QEpyRtHw8DmMA9JQfFklxVGxw8fylUxVi9fVRgph99GrDNyC8+WMl68308dF4XvfQ5R5sKT3ol8ZeIWIFdddKqceMrPTILKpCH0qFhsled5qTj/SkxjNw7hRhN6QIhkcMfLj73RlDS741NevGtZzi5R8k6BH2qHb0347I17waeRiS92/0tSZgXgZKGvuBlsJrLyospTfubH3bbKB8eXQ/DEzOXvrw5Bh9/sLu7n8rLfZYEcQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6960.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(376002)(39860400002)(366004)(396003)(33430700001)(7696005)(53546011)(55236004)(316002)(8936002)(52536014)(186003)(5660300002)(66446008)(8676002)(54906003)(76116006)(66946007)(4326008)(66476007)(66556008)(64756008)(9686003)(478600001)(110136005)(55016002)(71200400001)(33440700001)(6506007)(6636002)(26005)(2906002)(86362001)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: XZ6whJ7G/Y2LUe+To4cDryIukHZW6FZec446SFlPZw6OKakLrVkKybBJ79ScVH/cDIlAFXB6XCIaR/DQz8U3PP/EdK8K4Rw+BoR/Jw9gNI4lyP/wlBiEvytmY8Hhoqmt3u6+I2cXlPOKC6HXdaQXr8T7giLkWzOrK8X6aub7ShNLuJd08H1UwMToKDS5iHewHvT5txEUxAulY6+WXlMCiOoK14SIjt5MTZRWiTgns9pwJKkzJU0q1dKu5WNowPUmyCYywhKK7T3wwHIt0w9HQMSlQsLUBAiOPaER2qa3zU022O3x2thyWoAyYEEY/kytpwKMRby0C3nkAbKxrD2LbTahBdA66o6cMu/DrEaE91tUKz3uOO7TezaSu1uFlDyp3l8k4Rt3PADKe2vr9y80hxBPeTFdXM0FV5qHY+lvWLMp74HhdcIh1sS5ADXv/KtQ9as9FNfNWOH3uPsZ8ATXPNoM7SjdfJ5tUUV1q2VUG8k= 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: 591d3813-f1e7-43a7-15f6-08d7f4a67869 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2020 05:53:31.6482 (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: eJbtWTq7JX0ApkTkaKmNSUMqbpS2G5SQPHD1qSEJ4z4npmfo+UhGsoBwVsGLbIJm X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1SPR01MB0354 Subject: Re: [dpdk-dev] [PATCH] crypto/caam_jr: fix wrong check of fd 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Yunjian, > -----Original Message----- > From: Gagandeep Singh > Sent: Saturday, May 9, 2020 11:14 PM > To: wangyunjian ; dev@dpdk.org; Akhil Goyal > > Cc: Hemant Agrawal ; jerry.lilijun@huawei.com; > xudingke@huawei.com; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] crypto/caam_jr: fix wrong check of fd >=20 >=20 >=20 > > -----Original Message----- > > From: wangyunjian > > Sent: Sunday, April 26, 2020 6:31 PM > > To: dev@dpdk.org > > Cc: Gagandeep Singh ; Hemant Agrawal > > ; jerry.lilijun@huawei.com; > > xudingke@huawei.com; Yunjian Wang ; > > stable@dpdk.org > > Subject: [dpdk-dev] [PATCH] crypto/caam_jr: fix wrong check of fd > > > > From: Yunjian Wang > > > > Zero is a valid fd. It will fail to check the fd if the fd is zero. > > > > Fixes: e7a45f3cc245 ("crypto/caam_jr: add UIO specific operations") > > Cc: stable@dpdk.org > > > > Signed-off-by: Yunjian Wang > > --- > > drivers/crypto/caam_jr/caam_jr_uio.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c > > b/drivers/crypto/caam_jr/caam_jr_uio.c > > index b1bb44ca4..658de5460 100644 > > --- a/drivers/crypto/caam_jr/caam_jr_uio.c > > +++ b/drivers/crypto/caam_jr/caam_jr_uio.c > > @@ -145,7 +145,7 @@ file_read_first_line(const char root[], const char > > subdir[], > > "%s/%s/%s", root, subdir, filename); > > > > fd =3D open(absolute_file_name, O_RDONLY); > > - SEC_ASSERT(fd > 0, fd, "Error opening file %s", > > + SEC_ASSERT(fd >=3D 0, fd, "Error opening file %s", > > absolute_file_name); > > > > /* read UIO device name from first line in file */ > > @@ -389,7 +389,7 @@ uio_job_ring *config_job_ring(void) > > > > /* Open device file */ > > job_ring->uio_fd =3D open(uio_device_file_name, O_RDWR); > > - SEC_ASSERT(job_ring->uio_fd > 0, NULL, > > + SEC_ASSERT(job_ring->uio_fd >=3D 0, NULL, > > "Failed to open UIO device file for job ring %d", > > job_ring->jr_id); > > > > @@ -488,7 +488,7 @@ sec_cleanup(void) > > /* I need to close the fd after shutdown UIO commands need to > > be > > * sent using the fd > > */ > > - if (job_ring->uio_fd !=3D 0) { > > + if (job_ring->uio_fd >=3D 0) { > > CAAM_JR_INFO( > > "Closed device file for job ring %d , fd =3D %d", > > job_ring->jr_id, job_ring->uio_fd); > > -- > > 2.19.1 > > >=20 >=20 > Reviewed-by: Gagandeep Singh >=20 "job_ring->uio_fd" is currently defined as uint32_t, so your patch will cre= ate the compilation issue. Please change it to int.