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 82634460D6; Tue, 21 Jan 2025 18:10:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C14E040A73; Tue, 21 Jan 2025 18:08:48 +0100 (CET) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id B933E40667 for ; Tue, 21 Jan 2025 18:08:37 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2169.outbound.protection.outlook.com [104.47.17.169]) by mx-outbound22-172.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ms8Vq8Qlp8Zfb3BcTNSIPTDcjmxIp/A3K19WJnBW3sVJPGF9ou4xTPkqALrMkLIqt1OzbRooIIp+LtLqziNBszIk4C9xD4L/DoJxRRHySo3INjhS3yhPqJFoQ0Al0RSQlUu5vMGueNyZJsrSb8cssFIrySLch7LUUDeUMroDkHGy45GpXJXzI8ecjPS9KKFCWj6HjKzbsA6v2eI9n0mjN9q1/0mljFGgRxk+WSTiOxWInNyMHUtNcMkZsJO+iJTCPVEJy1Uw2DkHog/Wqb1K7tZXoa0N6q0DIuo4X6L2mYs8CsLi1wEYjRr+abbif+D5aEkb6XDAQbbFgfRrK+Ed0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=w/5OorzN93J9AxNLk5sE1aOAhzODKmSBFDgux7H/fso=; b=nZrTLYWSir/16kRFxPfJqSXh5CclXUp1NdA2zEZzEmOrk+fum14fptFM4prf2me9hfiW9oYZq6m3o1WOsjCQU9LY0dAO1a7joYGFJvOxzB82fshtHd7HP+MCIFvlj0R6GrT5KCbrHcplWZ5sYmvmF8//68QGzCUr9zN3OTj1z4xUlBiWFsOdYLUyn/LiIAzGwvWHHpIEcpGYqkXf3hlBl78vLfEJXHtRttIobvtRfwPUwv0YKEsNvqUAdmCv7nYKocukpr+7JDTh5nyoVpFEFWGJmbI1aZwaeLOVWzZCtfPAL9X+vJtVerxPdUPwYBGv4Jw1cFVpxEXMriao10qGiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w/5OorzN93J9AxNLk5sE1aOAhzODKmSBFDgux7H/fso=; b=QMvPbR2aT/XkbVHbZiZ/ePCBfIbnet++RhqzUmI3HE95BnCTcFGZJVkmn+cUi9JPznK8Pwd8lYgP1qz13+2TbEJRn8etV6PYfaWfvPsRTSKOaAr/EJLejdQLdt/E2Wg4UKMPcakgNBiuDbh5BeE2IANM1JrorIZgicoXszYnqjY= Received: from AS4P251CA0016.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::8) by GV1P190MB1921.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:51::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Tue, 21 Jan 2025 17:08:30 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::8e) by AS4P251CA0016.outlook.office365.com (2603:10a6:20b:5d3::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.22 via Frontend Transport; Tue, 21 Jan 2025 17:08:30 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server id 15.20.8377.8 via Frontend Transport; Tue, 21 Jan 2025 17:08:30 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, stephen@networkplumber.org, Danylo Vodopianov , Oleksandr Kolomeiets Subject: [PATCH v1 11/31] net/ntnic: add null checking Date: Tue, 21 Jan 2025 18:07:49 +0100 Message-ID: <20250121170814.3252171-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20250121170814.3252171-1-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70A:EE_|GV1P190MB1921:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c422373f-126f-4cbf-7b9f-08dd3a3e3ab6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Eq1kWLaghyt+XnQsCqAK7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q?/qwpb2RaP84zkrTX92bBHW0/LP6y6N7K0JX8pvbwBs+jmCPS2Z5oal7GGlfS?= =?us-ascii?Q?Rg7kya/TCosxHRETwYNopPvyeK5xzsj7Aw8G7RrAK9/WL2D4Kth/AMdxHe1j?= =?us-ascii?Q?h+oOi+dXvTMqkOxfalBK412USU/nODXgCfDQQL6Yfa0/9E3VAgEmlE0y9UvR?= =?us-ascii?Q?+jtdodIITllQ585fXp8y4HKSXGarvMdyokrzgjeUlOdiXfIyjHVgaanvFL4G?= =?us-ascii?Q?GSnhWi8WeP8hrNTuhPXF+lp9zDi8+xgYcDCsZkV9jTt9LWum4nR7OVK7MHIo?= =?us-ascii?Q?BlUgK9aIbkis9stDY8TcKH3YnJ9g73JVyj/goL01RQqzgBGLH4Xd67qYEW/p?= =?us-ascii?Q?ehxBdxCWPu3kw3agxXv5VZbWjhJ4h5yGvHwWCDbb46yRN8t5yfTvxjN+GcWG?= =?us-ascii?Q?xkbOiSJ3t1s6bUl2ru3X+f35k2HIJ4oLfYQYVoTkKYjR4mL2ITMEWES5LmNc?= =?us-ascii?Q?04Wiun40WLtSHsKCYMTGesrrx+LiGaAWrIMzOPed1SK8WNLqQ1cGearU4yRJ?= =?us-ascii?Q?pL8xTPBhiqVWdWlHsPMknYjM5umJPpBMvao+WiS1zTLpw2bHwV63pQ=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wzI43gDyDUsVO3k4/EQZcs8ZQmhp57fDY3cePE3wNhqLa/VVpBxeeC+KVLV2QwW6JpnKuqasyXJ74GvLZeSgfwAGK3hlFPfLnoBo3pkp/X11eO2PHUNVdqjn7s9Qod6yCC1AscYNF79iLcmCuaWTB9urkXmq3XUk6+0nCyKT7onp+QnZWygPwEqFa1SL7ZUI8XCslSq8FyamRTtycdhkufFcbx0CfEyCjPddyXO7zO2jk2n/IQCRPRosfBWYME9/yyekQzKa6gBVCBvYunAlf3FmeLM0AZfAGYDZ8iurJteiZPsgjmt0ZV7MjBITsFlHyqXiTs0/90vx1fakh+W0cet3bnQy943u5rcw4HAK5SHwwNfCGyVBqrUsvrwML/Z6Ln1AWChghhoLMk3g8xk9dL9f7vsrVem4eDmmaWxuEkJROTJnhPRWZhXySIbF+LdRfe7zTF4THyyyET4J7nO5ri0aKssAHM460vPbwTKyr1aS6HJp9uTkO/nCf0aYf6QzMHFs81ldIsag+yeEtfciTVSnPCEAtYHlInbU1Qzzi0lpMMobz/dNBU5W0Dofspu4o1cWxa5XZ8ksVelBN0AcRfTsjuQqGt5O/UIEq/TuHuj4QGcKYi7bv3dzAcwlMR4UCgWZ3uIsRlqQr1Pd4WJY+Q== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:30.2337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c422373f-126f-4cbf-7b9f-08dd3a3e3ab6 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P190MB1921 X-BESS-ID: 1737479316-305804-13354-8291-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.17.169 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkZGJpZAVgZQ0DTRzDAlLTnJ0M gw1dI8LdHECEhYGlkYJRtaJFomWyjVxgIAYcJ8I0EAAAA= X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan12-69.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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: Danylo Vodopianov Fix issue with potential rereferencing a pointer that might be NULL p->m_rpp_lr when calling nthw_module_query_register CID 448923: Dereference null return value (NULL_RETURNS) Coverity issue: 448923 Fixes: f543ca6b9ab2 ("net/ntnic: add RPP local retransmit (RPP LR) flow module") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c index 28c7a05fe2..e69a1ca823 100644 --- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c +++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c @@ -54,18 +54,20 @@ int rpp_lr_nthw_init(struct rpp_lr_nthw *p, nthw_fpga_t *p_fpga, int n_instance) p->mp_fpga = p_fpga; p->m_physical_adapter_no = (uint8_t)n_instance; p->m_rpp_lr = nthw_fpga_query_module(p_fpga, MOD_RPP_LR, n_instance); - - p->mp_rcp_ctrl = nthw_module_get_register(p->m_rpp_lr, RPP_LR_RCP_CTRL); + if (p->m_rpp_lr) + p->mp_rcp_ctrl = nthw_module_get_register(p->m_rpp_lr, RPP_LR_RCP_CTRL); p->mp_rcp_addr = nthw_register_get_field(p->mp_rcp_ctrl, RPP_LR_RCP_CTRL_ADR); p->mp_rcp_cnt = nthw_register_get_field(p->mp_rcp_ctrl, RPP_LR_RCP_CTRL_CNT); - p->mp_rcp_data = nthw_module_get_register(p->m_rpp_lr, RPP_LR_RCP_DATA); + if (p->m_rpp_lr) + p->mp_rcp_data = nthw_module_get_register(p->m_rpp_lr, RPP_LR_RCP_DATA); p->mp_rcp_data_exp = nthw_register_get_field(p->mp_rcp_data, RPP_LR_RCP_DATA_EXP); p->mp_ifr_rcp_ctrl = nthw_module_query_register(p->m_rpp_lr, RPP_LR_IFR_RCP_CTRL); p->mp_ifr_rcp_addr = nthw_register_query_field(p->mp_ifr_rcp_ctrl, RPP_LR_IFR_RCP_CTRL_ADR); p->mp_ifr_rcp_cnt = nthw_register_query_field(p->mp_ifr_rcp_ctrl, RPP_LR_IFR_RCP_CTRL_CNT); - p->mp_ifr_rcp_data = nthw_module_query_register(p->m_rpp_lr, RPP_LR_IFR_RCP_DATA); + if (p->m_rpp_lr) + p->mp_ifr_rcp_data = nthw_module_query_register(p->m_rpp_lr, RPP_LR_IFR_RCP_DATA); p->mp_ifr_rcp_data_ipv4_en = nthw_register_query_field(p->mp_ifr_rcp_data, RPP_LR_IFR_RCP_DATA_IPV4_EN); p->mp_ifr_rcp_data_ipv6_en = -- 2.45.0