From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>
Cc: <jerinj@marvell.com>, <dev@dpdk.org>,
Rakesh Kudurumalla <rkudurumalla@marvell.com>
Subject: [PATCH v4 15/23] common/cnxk: resolve klocwork issues
Date: Fri, 7 Nov 2025 16:17:39 +0530 [thread overview]
Message-ID: <20251107104747.1131008-15-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20251107104747.1131008-1-ndabilpuram@marvell.com>
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Fix klockwork for NULL pointer dereference
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
drivers/common/cnxk/roc_nix_queue.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c
index 2c7fce1067..c7e37abf32 100644
--- a/drivers/common/cnxk/roc_nix_queue.c
+++ b/drivers/common/cnxk/roc_nix_queue.c
@@ -112,6 +112,11 @@ roc_nix_sq_ena_dis(struct roc_nix_sq *sq, bool enable)
{
int rc = 0;
+ if (!sq) {
+ rc = NIX_ERR_PARAM;
+ goto done;
+ }
+
rc = roc_nix_tm_sq_aura_fc(sq, enable);
if (rc)
goto done;
@@ -2163,9 +2168,9 @@ nix_sqb_mem_dyn_free(uint64_t aura_handle, uint16_t count)
int
roc_nix_sq_fini(struct roc_nix_sq *sq)
{
- struct roc_nix *roc_nix = sq->roc_nix;
- bool sq_resize_ena = roc_nix->sq_resize_ena;
struct ndc_sync_op *ndc_req;
+ struct roc_nix *roc_nix;
+ bool sq_resize_ena;
struct mbox *mbox;
struct nix *nix;
uint16_t qid;
@@ -2174,6 +2179,9 @@ roc_nix_sq_fini(struct roc_nix_sq *sq)
if (sq == NULL)
return NIX_ERR_PARAM;
+ roc_nix = sq->roc_nix;
+ sq_resize_ena = roc_nix->sq_resize_ena;
+
nix = roc_nix_to_nix_priv(roc_nix);
mbox = (&nix->dev)->mbox;
@@ -2228,7 +2236,7 @@ sqb_aura_dyn_expand(struct roc_nix_sq *sq, uint16_t count)
int i;
blk_sz = nix->sqb_size;
- sqbs = calloc(1, count * sizeof(uint64_t *));
+ sqbs = calloc(1, count * sizeof(uint64_t));
if (!sqbs)
return -ENOMEM;
@@ -2300,7 +2308,7 @@ sqb_aura_dyn_contract(struct roc_nix_sq *sq, uint16_t count)
cycles = (timeout * 10 * plt_tsc_hz()) / (uint64_t)1E6;
cycles += plt_tsc_cycles();
- sqbs = calloc(1, count * sizeof(uint64_t *));
+ sqbs = calloc(1, count * sizeof(uint64_t));
if (!sqbs)
return -ENOMEM;
--
2.34.1
next prev parent reply other threads:[~2025-11-07 10:49 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 7:30 [PATCH 01/19] common/cnxk: add new TM tree for SDP interface Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 02/19] net/cnxk: new " Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 03/19] net/cnxk: disable CQ when SQ stopped Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 04/19] net/cnxk: update scatter check as warning for SDP Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 05/19] common/cnxk: fix inline device API Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 06/19] common/cnxk: add new mailbox to configure LSO alt flags Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 07/19] common/cnxk: add IPv4 fragmentation offload Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 08/19] common/cnxk: update DF flag in IPv4 fragments Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 09/19] common/cnxk: add support for per packet SQ count update Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 10/19] common/cnxk: feature fn to check 16B alignment Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 11/19] common/cnxk: add API to configure backpressure on pool Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 12/19] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 13/19] common/cnxk: add support for SQ resize Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 14/19] common/cnxk: increase Tx schedular count Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 15/19] common/cnxk: resolve klocwork issues Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 16/19] common/cnxk: avoid null SQ access Nithin Dabilpuram
2025-09-22 8:26 ` Jerin Jacob
2025-09-01 7:30 ` [PATCH 17/19] common/cnxk: change in aura field width Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 18/19] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
2025-09-01 7:30 ` [PATCH 19/19] drivers: fix Klocwork issues Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 01/19] common/cnxk: add new TM tree for SDP interface Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 02/19] net/cnxk: new " Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 03/19] net/cnxk: disable CQ when SQ stopped Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 04/19] net/cnxk: update scatter check as warning for SDP Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 05/19] common/cnxk: fix inline device API Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 06/19] common/cnxk: add new mailbox to configure LSO alt flags Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 07/19] common/cnxk: add IPv4 fragmentation offload Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 08/19] common/cnxk: update DF flag in IPv4 fragments Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 09/19] common/cnxk: add support for per packet SQ count update Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 10/19] common/cnxk: feature fn to check 16B alignment Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 11/19] common/cnxk: add API to configure backpressure on pool Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 12/19] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 13/19] common/cnxk: add support for SQ resize Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 14/19] common/cnxk: increase Tx schedular count Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 15/19] common/cnxk: resolve klocwork issues Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 16/19] common/cnxk: fix null SQ access Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 17/19] common/cnxk: change in aura field width Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 18/19] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 19/19] drivers: fix Klocwork issues Nithin Dabilpuram
2025-10-15 6:41 ` Jerin Jacob
2025-10-23 17:27 ` [PATCH v3 01/19] common/cnxk: add new TM tree for SDP interface Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 02/19] net/cnxk: new " Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 03/19] net/cnxk: disable CQ when SQ stopped Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 04/19] net/cnxk: update scatter check as warning for SDP Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 05/19] common/cnxk: fix inline device API Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 06/19] common/cnxk: add new mailbox to configure LSO alt flags Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 07/19] common/cnxk: add IPv4 fragmentation offload Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 08/19] common/cnxk: update DF flag in IPv4 fragments Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 09/19] common/cnxk: add support for per packet SQ count update Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 10/19] common/cnxk: feature fn to check 16B alignment Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 11/19] common/cnxk: add API to configure backpressure on pool Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 12/19] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 13/19] common/cnxk: add support for SQ resize Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 14/19] common/cnxk: increase Tx schedular count Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 15/19] common/cnxk: resolve klocwork issues Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 16/19] common/cnxk: fix null SQ access Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 17/19] common/cnxk: change in aura field width Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 18/19] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
2025-10-23 17:27 ` [PATCH v3 19/19] drivers: fix Klocwork issues Nithin Dabilpuram
2025-10-23 18:47 ` Thomas Monjalon
2025-11-04 15:28 ` Jerin Jacob
2025-11-07 10:47 ` [PATCH v4 01/23] common/cnxk: add new TM tree for SDP interface Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 02/23] net/cnxk: new " Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 03/23] net/cnxk: disable CQ when SQ stopped Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 04/23] net/cnxk: update scatter check as warning for SDP Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 05/23] common/cnxk: fix inline device API Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 06/23] common/cnxk: add new mailbox to configure LSO alt flags Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 07/23] common/cnxk: add IPv4 fragmentation offload Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 08/23] common/cnxk: update DF flag in IPv4 fragments Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 09/23] common/cnxk: add support for per packet SQ count update Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 10/23] common/cnxk: feature fn to check 16B alignment Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 11/23] common/cnxk: add API to configure backpressure on pool Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 12/23] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 13/23] common/cnxk: add support for SQ resize Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 14/23] common/cnxk: increase Tx schedular count Nithin Dabilpuram
2025-11-07 10:47 ` Nithin Dabilpuram [this message]
2025-11-07 10:47 ` [PATCH v4 16/23] common/cnxk: fix null SQ access Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 17/23] common/cnxk: change in aura field width Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 18/23] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 19/23] common/cnxk: fix format specifier for bandwidth profile ID Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 20/23] common/cnxk: fix CPT res address config for inline Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 21/23] common/cnxk: fix NIX Rx inject enable logic Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 22/23] net/cnxk: fix illegal access of Rx inject LF Nithin Dabilpuram
2025-11-07 10:47 ` [PATCH v4 23/23] net/cnxk: check for invalid default pre color Nithin Dabilpuram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251107104747.1131008-15-ndabilpuram@marvell.com \
--to=ndabilpuram@marvell.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=rkudurumalla@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).