mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Ian Rogers <irogers@google.com>
Cc: Sunil Goutham <sgoutham@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<llvm@lists.linux.dev>, Elkin Cruz <elkin@google.com>
Subject: Re: [PATCH net v2] octeontx2-af: Fix uninitialized variables in MCS alloc handlers
Date: Thu, 26 Nov 2026 07:30:16 +0530	[thread overview]
Message-ID: <aweSsCquVuAOvvUW@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20261125004227.1007723-1-irogers@google.com>

On 2026-11-25 at 06:12:27, Ian Rogers (irogers@google.com) wrote:
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> index cd9cca5a9cf5..92c987134436 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> @@ -682,12 +682,15 @@ int rvu_mbox_handler_mcs_alloc_resources(struct rvu *rvu,
>  {
>  	u16 pcifunc = req->hdr.pcifunc;
>  	struct mcs_rsrc_map *map;
> +	int rsrc_id = 0, i;
>  	struct mcs *mcs;
> -	int rsrc_id, i;
>
>  	if (req->mcs_id >= rvu->mcs_blk_cnt)
>  		return MCS_AF_ERR_INVALID_MCSID;
>
> +	if (!req->all && !req->rsrc_cnt)
> +		return -EINVAL;
> +
>  	mcs = mcs_get_pdata(req->mcs_id);
>
>  	if (req->dir == MCS_RX)
> @@ -744,6 +747,9 @@ int rvu_mbox_handler_mcs_alloc_resources(struct rvu *rvu,
>  			rsp->rsrc_cnt++;
>  		}
>  		break;
> +	default:
> +		mutex_unlock(&rvu->rsrc_lock);
> +		return -EINVAL;
>  	}
>
>  	rsp->rsrc_type = req->rsrc_type;
> @@ -793,6 +799,9 @@ int rvu_mbox_handler_mcs_alloc_ctrl_pkt_rule(struct rvu *rvu,
>  	case MCS_CTRL_PKT_RULE_TYPE_MAC:
>  		offset = MCS_CTRLPKT_MAC_EN_RULE_OFFSET;
>  		break;
> +	default:
> +		mutex_unlock(&rvu->rsrc_lock);
> +		return -EINVAL;
Thanks.

May be we need to add some debug prints as same error code is returned for all these
error cases.

Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>

      reply	other threads:[~2026-11-26  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  0:42 Ian Rogers
2026-11-26  2:00 ` Ratheesh Kannoth [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=aweSsCquVuAOvvUW@rkannoth-OptiPlex-7090 \
    --to=rkannoth@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=elkin@google.com \
    --cc=gakula@marvell.com \
    --cc=irogers@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@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

all inboxes | Powered by JetHome®