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 77AC445492; Wed, 19 Jun 2024 11:59:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABCC542D72; Wed, 19 Jun 2024 11:58:56 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2103.outbound.protection.outlook.com [40.107.236.103]) by mails.dpdk.org (Postfix) with ESMTP id 65E0C427DE; Wed, 19 Jun 2024 11:58:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j9oJfePo5Z3kKLhrBn4K4rDg/6p/vnLtEovYtqGyjwcmYY8Hucp2EhtJt6rU/r9S5FxsCPl3BrQNIA0f44RBlFj/tRKOHEitWjpqqXsxcCSJKp02xWlHhvSzRFeD1ByZHSiRKO+ZpV0O0tIyUJDz3GjpZmTTipCtGDQagVGStfn+8cYKlzhhAGW/OudLFM/twidIit7wGC3thCx+UjmYjSxt0M6htyhgk0l+8Wrq3EKSfK378uwWh0bEuK+CtcgMnxBmGsPLAZ21VDm9PwPYkxT8PAoeF1J54l/no+NzXSWtxIfA7tSOheCGwahrH8HB6TLv8l7+kDC5xzMqM1WvQw== 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=IXIJFSdh5AHUQsnyLrlC0+fBmJ9xdIH9uu91Qn0Y5Ro=; b=LysX+bpxqq303UhBYYEO0iIbmEU6qqRV7WRoQ1naWxA3N4cF89Hk/NIkCWYxNRmzx/XpnO/tT3pfpAx1tkOkwZNhnZExD8yXI7qw/lZWo1dzs0PCsFLKtM8oyXl83ko8v0JYiBpjDD0yEN3P3Bk+Tu5Y6gAxvNyv+w8xLAkSQdy9osqX7/jgRlm7CpnVzSpgp855TtiGmAZsmV0Up34Z5drDDEgYRN95W6kCFfQv4StaKu7TGiIIzosd0WUwwtx/b5tpt4wmmpbIPnPZLFVuYCLYjeAJQVGuFFG4cumjQC733rvI6DhIBZLemkjadHcNS4Ds1DFI66WcowcYZ4X4xQ== 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=IXIJFSdh5AHUQsnyLrlC0+fBmJ9xdIH9uu91Qn0Y5Ro=; b=GlraHdKwf1L7Hs1+OOiuudu3v19oIbk+2cAhhbAB93Te4QfgMvpiSGTYh7sx4G3ICcJnFVa+XxPRXzCMlE7a3hmcZniUuAiAXvp3z4/wYypkqqa154YBCupOzF5vxbh6d0YGpsR1NLlZmf4NfNjBrKK9OJqdOJop0CQEV6KYgjQ= 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 CO3PR13MB5782.namprd13.prod.outlook.com (2603:10b6:303:171::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.20; Wed, 19 Jun 2024 09:58:54 +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.7677.030; Wed, 19 Jun 2024 09:58:54 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Peng Zhang , james.hershaw@corigine.com, stable@dpdk.org, Chaoyong He , Long Wu Subject: [PATCH 03/23] net/nfp: fix dereference of null pointer Date: Wed, 19 Jun 2024 17:58:10 +0800 Message-Id: <20240619095830.3479757-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619095830.3479757-1-chaoyong.he@corigine.com> References: <20240619095830.3479757-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0057.namprd13.prod.outlook.com (2603:10b6:a03:2c2::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO3PR13MB5782:EE_ X-MS-Office365-Filtering-Correlation-Id: 52011f36-8251-4f55-7f9f-08dc90466d98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|366013|52116011|376011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YsibDKxHnbv0J2YnGorpKiSbsY/PWxHfGhboV0dVh+S/1XiwxHECmC+76yLY?= =?us-ascii?Q?LsEcZQopdI14bjVbmUIolh5pgHNIcrHmein3NMPrqjjGPj0IV5Itqui90k+4?= =?us-ascii?Q?DyAOxkSjHZv+l6DvP2iPVSYwMagoy1fmIqi8fy+NsGaqAy0NPeBv9hivGnQM?= =?us-ascii?Q?aYW0/ZjFy7k0NQPp6N28mF0YmMSmJh/a23jzvAKDlsZEO0zZEAiSz4WgFHkf?= =?us-ascii?Q?4cGIADe7YESD5AxHIW4aZFQwBX+sD6O4VXldCYd9qqydbXfQGupTpHeWAcZO?= =?us-ascii?Q?ze0zebvR/NYDk50tHbWlU7tUJJyV2Flx3tEcSfEv0N6/QgEQoCwa1WthRa01?= =?us-ascii?Q?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2iCtPBBWVx?= =?us-ascii?Q?zhsp0yUVzKDfX3g0pnxbNhoV8t/WqT4epYBH+bJ2onYlCq42PZN0cw5lWkqD?= =?us-ascii?Q?UyMnFcAgOPqJW1XaqdoNHV0e2V7Uh4d7UN8pKf/W2CfpZM3BHTf2kqNhN3Hj?= =?us-ascii?Q?hIDgIvg=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)(366013)(52116011)(376011)(1800799021)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xpZP1ML39w0ocdGdPANWV47b/n42TfPTZ/EEh4cav3qTwKZD0pcjihlce02Z?= =?us-ascii?Q?F/uYYYj1PJaxAlkdyi5JjxRk3N+3iZPJeb1PwkTjbacZeNxUfeRywoCrMLQ5?= =?us-ascii?Q?xtf2420xRoqxSnH55BGkO0To4h8OYJV8QMKbWZDGTdFagTtnmYsqasKdUB04?= =?us-ascii?Q?sIiwuszXWdhz/xWCVVwE3zmUmvk2bWGaIjy8chtUrIWCeIFw8zcWRq3I9IHh?= =?us-ascii?Q?YoRX7wRAzpECHT4zMOxaCR/lRGny9IAunSSsghZfVe7Qh2K5LR655rbRJ+yZ?= =?us-ascii?Q?VUB8J4RrFBFBBIT4uhM+VTRrykowEj/smbpJ2NFl55XwSt9EBB4yJCZBjlyb?= =?us-ascii?Q?eFdHLsweTiMXby0TVzcFBvf7KUbePg0zYmwn04SqZbnOPRI99EwEvHK0//bm?= =?us-ascii?Q?trlGnU4P0DZbN1JXwAG6XzXp+o+w8Jm93uz41U+Tw8uhAPGf+4H/7XjkohNV?= =?us-ascii?Q?PjSyFDNWESGtHKQdmHg7KAFQMYI+meufFnDJ91oBrxpGKZypHOtBI+iiI5hQ?= =?us-ascii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HylGCY2wd+zBdDo3V2XolH?= =?us-ascii?Q?1588EXmC4lJ4G/uI3I1RDdHp6gUtdj7Dv1VOK/GTyzA4jamryud37MgWCp5N?= =?us-ascii?Q?C/+W/Ae9ZIN/8rKJWz1mfhkrgLVQGM0nkiF7PL++IIHkG+V5/r6BIecQuQWx?= =?us-ascii?Q?kCcSylaG6GJlqYZYi9Vbm465LUjuzx+ScdvGoGIYJEwRYgxhD1K3hLX3N9YK?= =?us-ascii?Q?MQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52011f36-8251-4f55-7f9f-08dc90466d98 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 09:58:54.3388 (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: UeLcsl3H6BsyffTsxstli9NfZe449h7rL23GIjWWLHzg6iLNceg0GhK09RtpOeCVjWx60ItPLoeCsB8hO/6JWmbHQc85fCZ4h/szY6gXcPA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5782 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 From: Peng Zhang The original logic can not make sure the 'repr' pointer has valid value and the dereference of null pointer will cause a segment fault problem. Fixes: eae7dadbe987 ("net/nfp: update link status reporting") Cc: james.hershaw@corigine.com Cc: stable@dpdk.org Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/nfp/flower/nfp_flower_ctrl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index de6e419cac..8cfafe91c8 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -441,6 +441,11 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower, return -EINVAL; } + if (repr == NULL) { + PMD_DRV_LOG(ERR, "Can not get 'repr' for port %#x", port); + return -EINVAL; + } + repr->link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX; if ((msg->info & NFP_FLOWER_CMSG_PORT_MOD_INFO_LINK) != 0) repr->link.link_status = RTE_ETH_LINK_UP; -- 2.39.1