All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Ratheesh Kannoth <rkannoth@marvell.com>,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	naveenm@marvell.com, netdev@vger.kernel.org,
	sgoutham@marvell.com
Cc: andrew+netdev@lunn.ch, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, richardcochran@gmail.com,
	Suman Ghosh <sumang@marvell.com>
Subject: Re: [PATCH net] octeontx2: Fix Klocwork issues in AF and PF drivers
Date: Tue, 14 Jul 2026 16:50:31 +0100	[thread overview]
Message-ID: <06829124-18b1-478c-9f6a-d9ec372158ac@linux.dev> (raw)
In-Reply-To: <20260714020241.1810407-1-rkannoth@marvell.com>

On 14.07.2026 03:02, Ratheesh Kannoth wrote:
> From: Suman Ghosh <sumang@marvell.com>
> 
> Fix null dereference, uninitialized variable, and error-path resource
> leak findings reported by Klocwork across the OcteonTX2 AF and PF code.
> 
> Fixes: 818ed8933bd1 ("octeontx2-af: Re-enable MAC TX in otx2_stop processing")
> Cc: Naveen Mamindlapalli <naveenm@marvell.com>
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> ---
>   drivers/net/ethernet/marvell/octeontx2/af/cgx.c      | 12 +++++++++---
>   .../net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c   |  8 +++++---
>   drivers/net/ethernet/marvell/octeontx2/af/npc.h      |  6 +++---
>   drivers/net/ethernet/marvell/octeontx2/af/ptp.c      | 11 ++++++++++-
>   drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c  |  2 +-
>   drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c  |  2 +-
>   .../net/ethernet/marvell/octeontx2/af/rvu_debugfs.c  |  8 +++++++-
>   drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c  |  2 +-
>   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c  |  2 +-
>   .../net/ethernet/marvell/octeontx2/nic/otx2_flows.c  |  1 +
>   drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c |  3 +++
>   drivers/net/ethernet/marvell/octeontx2/nic/qos.c     |  1 +
>   12 files changed, 43 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> index 2e94d5105016..70c8ef5f0be0 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> @@ -491,12 +491,19 @@ int cgx_lmac_addr_max_entries_get(u8 cgx_id, u8 lmac_id)
>   u64 cgx_lmac_addr_get(u8 cgx_id, u8 lmac_id)
>   {
>   	struct cgx *cgx_dev = cgx_get_pdata(cgx_id);
> -	struct lmac *lmac = lmac_pdata(lmac_id, cgx_dev);
>   	struct mac_ops *mac_ops;
> +	struct lmac *lmac;
>   	int index;
>   	u64 cfg;
>   	int id;
>   
> +	if (!cgx_dev)
> +		return 0;
> +
> +	lmac = lmac_pdata(lmac_id, cgx_dev);
> +	if (!lmac)
> +		return 0;
> +

this 2 checks are added for impossible cases. both values are checked for
existence in a signle caller of cgx_lmac_addr_get(). Please, do not add
defensive code for no reason. I didn't check other changes, but I believe they
are of the same quality coming from yet-anothener-anaylizing tool.

Please, provide stack traces if these checks are really needed.

[...]

      reply	other threads:[~2026-07-14 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  2:02 [PATCH net] octeontx2: Fix Klocwork issues in AF and PF drivers Ratheesh Kannoth
2026-07-14 15:50 ` Vadim Fedorenko [this message]

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=06829124-18b1-478c-9f6a-d9ec372158ac@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=rkannoth@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.