From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA51B43332; Wed, 15 Nov 2023 04:23:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFB73402C7; Wed, 15 Nov 2023 04:23:38 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2119.outbound.protection.outlook.com [40.107.223.119]) by mails.dpdk.org (Postfix) with ESMTP id 67E92402C7; Wed, 15 Nov 2023 04:23:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m8eN1ctsVkboZEph2uM2ILo9b+mVaHsT1wglELG8DjxwqGT65KWMZiFZrapSkt1WuLPph42zEk3P4N+C+kOMZY+8WIT3PgYFflxITuuwd3xG4bJlKqHDNgWZ5Ws1Gc1kLlTdre+iQLlkddOB2dlC5MwZ6ITnncbGZqxnkOtDl17QBhd5p8UHZDbkyBU6iM3PkA6UNbbIWPJW9N5T1mzj0ipVyrH6I8LJDroCk9udl1wxfWZnoQirA1oGPArG7delE0Lc2HCLiaUvLiNotoyq25fBl4Z45RWU3GY/7NaQQXJqCKO4FkvUCmV/2sMJ42F51u7tDRwk65EAKokc5PBORg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xoiamL15Fd0u/AjhiH9kE9kNXnweJx4B/ErFKfoumN8=; b=ivbGSddOZ9WXxt/ol1TfS4/yov2rwwxH9+lEoAb8iXDmJo9jJwVTdx/tNLwx0nFMGWg8MQAWzKixLi8zgEEkJ2yd3Cdvw3prx2OFghfBplO1MfqVtWoV1D/DL0ATWXtp1QcCijsVW+3+g5P33vQQBtF8V4HKGK0M8V/KOSgZ9+naxNB2q34SEvZUhZDqPSKTNjd4BNjdGgaJb4SKcWiUYUO1K2TEWe5GHWS63I0jENWaupupAFSaoP5ibndlWX4NWrAZBN/1laQVppSLrg3Uye7kMQXJSv0l0dcUMBYCrEnrfFf3Xu+3D5lxXg1tXr3e3iCXQMpnNZ2jhhMnEqTxPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xoiamL15Fd0u/AjhiH9kE9kNXnweJx4B/ErFKfoumN8=; b=p4bFtnkWUNTwtPfmz4XtM+zkE2h7tUIp5lUq5i8vCzZhnPbltcCHiHZzJwTPszKqytQokRfEYmHIMG35Y6Fh/NjzjshIotHYgtcDnfnaFFSlXg4tOCpYb3u2udT/diSp8pTodB/OoqbYx+MRKsLgmbIKNtF68jACnGMvXkhdhiU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by CO3PR13MB5719.namprd13.prod.outlook.com (2603:10b6:303:171::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.17; Wed, 15 Nov 2023 03:23:33 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b%6]) with mapi id 15.20.6977.029; Wed, 15 Nov 2023 03:23:33 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 1/5] vdpa/nfp: fix checking return value Date: Wed, 15 Nov 2023 11:23:06 +0800 Message-Id: <20231115032310.756221-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231115032310.756221-1-chaoyong.he@corigine.com> References: <20231115032310.756221-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR10CA0023.namprd10.prod.outlook.com (2603:10b6:510:23d::21) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO3PR13MB5719:EE_ X-MS-Office365-Filtering-Correlation-Id: a0e0ac49-b445-409e-6a6c-08dbe58a3f43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ty+Pk7ODKjv+xCETVkNq2Ds4c+mHe6PeF5BUTc5vljelfEy1fZWzeRzBEa0DIAEdb2WGxRI0owNjU4hrAwNlIOcHYBXJOoL4tyiTN8IbQ6gt4lf1qK1wSJDEtY6bJQs/w7bC5zcE0Of7ljmwuYdRXDZ26BVsWt2a0s2z5T/VndeYvkMfTN+Daz3OHQ0mEMWdTuJw5WFqkdnW55wJiFIiuly8V+92ZEIsz7KWNgqjDGUzs58/q6lT74x6Nqkvj8zE/72VQVMXeInNTmqohLCC/PFxqJ0TL0IeI6i4ySVaF+Hn1IZ3V1BWTFmHGkOBI5Tkhx2bvALzXMNwlYLE2qXBPUUqlcnuwaR1k3ZcF6VxsN7LrgyjuSdtGz8HyaoK+ArOQpG5evK4JzTITCUMwrLyboTTchL0hfcLsdLD6DJMoLrp/gFKx4tKCzMYqqh0sMDd9E4jT+/QqGk4pIg7bzQY3JETub9lI6OCF4Rvx13y9rqkq3KlcpnE7dsUQK5+hINAqeJQehnRYWImkXs5kNovn6JHa0SWXHqjMc0Yf7kdljO9OQ5GYaCkQx0KYU615JeWaOQjt1pPzpZ1MVsVhjHDWeUfwTQNy8jB0kJ4xmIPQp/JQEH+m93mexf8hkis0taFw29asBqnKNEluUa1ehzPTQ/rxjuO2dIsbmia+rUEGyU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(39830400003)(366004)(346002)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(2616005)(6512007)(1076003)(107886003)(26005)(6486002)(478600001)(36756003)(44832011)(450100002)(8936002)(86362001)(4326008)(8676002)(5660300002)(41300700001)(2906002)(66556008)(54906003)(66476007)(66946007)(6916009)(316002)(38350700005)(6506007)(52116002)(6666004)(38100700002)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/lvft5ix+AoStn9KmVxxkEO4XlHWQmshbr8w5osZFY0Vi9EmYAE3/025azdn?= =?us-ascii?Q?T2gxChMtDTrXfcLICPRvlu3eS5ddPfmFI1sTg/D8dNq+ObKOWkpEOMi2+tY3?= =?us-ascii?Q?WhMl81f1+DDm7d+fgc90O7PQa2WlxVwLruKUzu+kBtBCNu+PHsJVb0pjuaA2?= =?us-ascii?Q?euExnY3MrXMt4U8tbl+z1JThfAn2KdeHKX0x8igsfz4fyzqGSfVo0BHibtSm?= =?us-ascii?Q?pXS8qeCfSwP6roS+WIxL9OldhXmo/J5H71cFQjPHCFGPRCJBZtbaWk5w5gS6?= =?us-ascii?Q?19aTzUVwugFdqnWODCQ4dBUkz2HwZVdMmdjEjfNOZXzjrNJ+WFnMHxcZm1IY?= =?us-ascii?Q?kYRsyMdFjxF86hkpwWX5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= =?us-ascii?Q?7y1TGQ6+cny0eURhP3b2sn8oOehVBtNsueLOidxcqf1X/+eXBypQgFPilMl3?= =?us-ascii?Q?+WNNUAMUhg9UK5mv1MhDNUjJFslhu1/G1WzU3aTCEpyEDuGJX5ExnprDau2C?= =?us-ascii?Q?C3q6HSUQu4x8lyI3iChCjXvVjvRE8fWNh8WcSy3RJ+5asQrFEQrN+3Kxbosh?= =?us-ascii?Q?hNrXmEj6u4pfbZzK92CQxatrwf9hWwrlwDl0JeK6PsGXCRHT5VTWoOchH6qz?= =?us-ascii?Q?vLayafTDog4Wz+VXGiXRs/2YVVZAC3uMau7CQegw3fAuUCC6T2Km/EOxF002?= =?us-ascii?Q?sKOaFrJ8wifmkBgqOgxq6tMN4NHtAhjGwIUkFkL+OFXdhmVIKGK2IICXG55I?= =?us-ascii?Q?hw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0e0ac49-b445-409e-6a6c-08dbe58a3f43 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2023 03:23:33.6469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ss4rqFC6iCzdXexVOod3BZcR1EJCDzvxvXdqpss9nnAVn7hTuVEdWfTi3m72py+8ZNJGmUl0UyPpAltgvPnVgBaDBTYy1T81y5c73DgUstU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5719 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org CI found calling 'rte_vfio_get_group_num()' without checking return value. Coverity issue: 405356 Fixes: 7b2a1228c59d ("vdpa/nfp: add remap PCI memory") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/vdpa/nfp/nfp_vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/nfp/nfp_vdpa.c b/drivers/vdpa/nfp/nfp_vdpa.c index a1d1dc4f73..cef80b5476 100644 --- a/drivers/vdpa/nfp/nfp_vdpa.c +++ b/drivers/vdpa/nfp/nfp_vdpa.c @@ -113,8 +113,10 @@ nfp_vdpa_vfio_setup(struct nfp_vdpa_dev *device) rte_pci_unmap_device(pci_dev); rte_pci_device_name(&pci_dev->addr, dev_name, RTE_DEV_NAME_MAX_LEN); - rte_vfio_get_group_num(rte_pci_get_sysfs_path(), dev_name, + ret = rte_vfio_get_group_num(rte_pci_get_sysfs_path(), dev_name, &device->iommu_group); + if (ret <= 0) + return -1; device->vfio_container_fd = rte_vfio_container_create(); if (device->vfio_container_fd < 0) -- 2.39.1