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 BA198454B8 for ; Mon, 24 Jun 2024 03:58:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE13940E17; Mon, 24 Jun 2024 03:58:19 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2103.outbound.protection.outlook.com [40.107.95.103]) by mails.dpdk.org (Postfix) with ESMTP id 77394406B8; Mon, 24 Jun 2024 03:58:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YFUq7tTfoOkI+hf1d6lJk32d5NE/aqM77xizLgS4g/9bGNQWe3jp9zREGsGDGuadei2bKDaZCeitCM2zG4tuuT5s01k2kAAnHOo+UBldQ30Cb6ONkzPTMEzzVJPyH6JnZ5F3qbx76FMghHzjP/RfkfiwICav1+gKcNHlWB+fubzt3KVceB6EN1zSzlFlelME2kPA/9B2FFTtQm40nfh+Pz/JPOLRMB/sAu7a2geYiCdWmuRgb5mFVm5WKAaqdixx2NgAzCktdEZMkc4Z2SdG4V9gAb7xXiWK/ODZKV2248KQbh/m6qewuLViOTwXWhoSnT+b0gJyivKrmASLQmADYg== 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=CySHejsqCjG6dcJ1VNbr0ub9azBDcRRg38E757821lg=; b=XBjqqzppGTGbqO8PPj70MXJA3ghQpjR5etRKuNR7420FtMjXAXEw/zGH5Bmtz09Bia64D00gE2nZLmY8kUcTwFfdEpQolaPkuFlWz/rjeOyO8UJKDIbzjnfFGbFCwFZYYhmXSHQNWNK2sQ3a0w/gKYlK6yI+LSw8pUqpDOKq3Ee1EPG6A0+uf/nkoqOCtoKpYXAwBYd/ij20dkFbakkhO6EcKF8HLY6P75WLj8Pma2CEdBWNvZpsPaowdN+C72lzD0N8QFFa/2acUd8dQMCzBLkF7/kg5K9Ed5J//2krIJj7kjStM4KgDAZ4Mjwk5BjRALtAbXpHI/FF8meT3GCadA== 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=CySHejsqCjG6dcJ1VNbr0ub9azBDcRRg38E757821lg=; b=BJe1HdS9LuUfkZpN1q4a18SI6bZGvtPPKKyLGzMeF/G9ewAMAqUCZZWB7bqfbdKQYUxzVfMrSFyHXqYT8WLGSAqEFzjb6AQ90QtekYFX0hoND8gKfE2H5FDYWq7gyroHPPxE/YK29jqLb0hjSI+Rtn9Q61tYZKbRXOFQQMV8Bkk= 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 PH7PR13MB5867.namprd13.prod.outlook.com (2603:10b6:510:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Mon, 24 Jun 2024 01:58:16 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7698.024; Mon, 24 Jun 2024 01:58:16 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 16/17] net/nfp: fix null pointer dereferences Date: Mon, 24 Jun 2024 09:57:22 +0800 Message-Id: <20240624015723.3712898-17-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240624015723.3712898-1-chaoyong.he@corigine.com> References: <20240624015723.3712898-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0070.namprd13.prod.outlook.com (2603:10b6:a03:2c4::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 91006fb0-cea1-4eb2-7892-08dc93f11cca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|366013|1800799021|376011|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tBKhCEDWy9Uf1t1r2Mk0cVxeEGpIBiWCVUx1qFJZ+YipZrxU3Rc1JempTCla?= =?us-ascii?Q?mCMXbnqeZSXleMLTU1RpYcVYhJaR2efvDtpIOdEE2kLpf0cFxBmaUEBlk9Ul?= =?us-ascii?Q?X0SmxFJZlNN+GLwqqgwELdfjfXo31u4iU1srA4byKwwae8N0KacnnsDGYahY?= =?us-ascii?Q?B8L8vNs/WLOw8/WrcLQ2HFIzhkgZwelQYw+js81AYGirH+igbkHZ/YEoG5WC?= =?us-ascii?Q?FNUyUvgBLGsQsmYAu7BIZz8snucaATgsR4jFuQPZFKRH5BqvLec/dXlcJCAY?= =?us-ascii?Q?OQUMLxuAOthODjp4nLuqd5XJvVdKbtE2ivLumOOOMtJvZlZhMjnb6FoGuroj?= =?us-ascii?Q?fYbDLFxqbQukFIfNRSzpy1sK0/aH8zEv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YZJqHU8zZgUIpeumuibwlP1sSU+OrCmWihPyIQciiBVI/eUvCpzKFTzvsv?= =?us-ascii?Q?CCz4D5dRsmuOrS33H9TUkguVc2WWvf+CC0w22xyIYzJtZhjc7UJKnsRX5XfI?= =?us-ascii?Q?dkEEHTs=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(52116011)(366013)(1800799021)(376011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fQ8P1NaHXaZZs2bEosZWN+8L7ghWCBloI6p8MK6lrsE4HihFYagfV2cdJjT0?= =?us-ascii?Q?AW+1AtvV5NhdntxZP1IZQ9Be8+rHSGWwstcE9A4/uIML0ba/g7eamMDQXhDo?= =?us-ascii?Q?XZbz60Z8QGQTSFR4V/0x0trCqGQv3xdTMpPz9YyOzoOiqycei1oZ/iK7AbJv?= =?us-ascii?Q?mFdb8hO9Cgqw6h4m69iLkMpwpmPckNqQxRYC577LZXleovATtV0U01VklrMH?= =?us-ascii?Q?8sv9rLwKmEWj8RTc8l55PvFwuStIIxA9XpFUFe/q2pLE6OWNSvIrZfVKixTE?= =?us-ascii?Q?+DWMW6TvCOg6wDbpW15YgXX+QkHRxo4KUUfVExeDspcYvfjIg4wkv9Umcyi4?= =?us-ascii?Q?3JsD8g0jzgSCtWkYhUaAh39wA4tyItj43Ij0lhoVxUpgdaB/aBq6Xh9hiOPa?= =?us-ascii?Q?Pb7mbHLyMKq69BCzh/oCWcFtVr3jBtMcj4bLtPAGc4RYlKdCJBPOrcQ0xJho?= =?us-ascii?Q?CnrWgcMIAcHxTj2X4yfbq3yCluMp8mifSvu5IzQkW5odDBinNzWLwS+RKe+q?= =?us-ascii?Q?Ttwv52fF6pssjlE/JIIas4hZ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5qsWYps/?= =?us-ascii?Q?WzeRlQ7GgMKvZpqqScJDUygDrz7LgWyyOYo1fG/4MQT3Ov8I3+UvDCSPlJRF?= =?us-ascii?Q?nqhOyroMjRnNUebi7wzHkJ2woR1xB/WZzZYWMugINTuEWeyAzhjWwqapoygv?= =?us-ascii?Q?QvqKfEGujHprGm4oPdv1JKlApNlDuNjT/sBk7OukcvMv8DWuejexLVQp4gtQ?= =?us-ascii?Q?Cw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91006fb0-cea1-4eb2-7892-08dc93f11cca X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2024 01:58:16.1699 (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: Yxg99DmFC5XTrkHuRn1LOa+QdRa7UeBjq73+8lQhfvL4JlXx9JNzFL3+rnQB7rCpvIH+W/qB9bQFP/Lpllr03uxtQSM4gosjXxHMu4AZSUI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5867 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org CI found null pointer dereferences problem. Coverity issue: 426271 Fixes: 153ef2e49ed7 ("net/nfp: add process private structure") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_net_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 84893e2d73..aed40daa67 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -1265,6 +1265,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) hw = nfp_net_get_hw(dev); hw_priv = dev->process_private; + if (hw_priv == NULL) + return -EINVAL; nfp_net_rx_desc_limits(hw_priv, &min_rx_desc, &max_rx_desc); nfp_net_tx_desc_limits(hw, hw_priv, &min_tx_desc, &max_tx_desc); @@ -1367,7 +1369,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) } /* Only PF supports getting speed capability. */ - if (hw_priv != NULL && hw_priv->pf_dev != NULL) + if (hw_priv->pf_dev != NULL) dev_info->speed_capa = hw_priv->pf_dev->speed_capa; return 0; -- 2.39.1