mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Hariprasad Kelam <hkelam@marvell.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net,
	willemdebruijn.kernel@gmail.com, andrew@lunn.ch,
	sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com,
	jerinj@marvell.com, sbhatta@marvell.com, naveenm@marvel.com,
	edumazet@google.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, maxtram95@gmail.com
Subject: Re: [net-next Patch v5 5/6] octeontx2-pf: Add support for HTB offload
Date: Tue, 28 Mar 2023 12:56:08 +0200	[thread overview]
Message-ID: <e6b7c24026e3750ea3e10a5ebf26bf2dd903e2a1.camel@redhat.com> (raw)
In-Reply-To: <20230326181245.29149-6-hkelam@marvell.com>

On Sun, 2023-03-26 at 23:42 +0530, Hariprasad Kelam wrote:
[...]
> +static int otx2_qos_root_add(struct otx2_nic *pfvf, u16 htb_maj_id, u16 htb_defcls,
> +			     struct netlink_ext_ack *extack)
> +{
> +	struct otx2_qos_cfg *new_cfg;
> +	struct otx2_qos_node *root;
> +	int err;
> +
> +	netdev_dbg(pfvf->netdev,
> +		   "TC_HTB_CREATE: handle=0x%x defcls=0x%x\n",
> +		   htb_maj_id, htb_defcls);
> +
> +	INIT_LIST_HEAD(&pfvf->qos.qos_tree);
> +	mutex_init(&pfvf->qos.qos_lock);

It's quite strange and error prone dynamically init this mutex and the
list here. Why don't you do such init ad device creation time?

> +
> +	root = otx2_qos_alloc_root(pfvf);
> +	if (IS_ERR(root)) {
> +		mutex_destroy(&pfvf->qos.qos_lock);
> +		err = PTR_ERR(root);
> +		return err;
> +	}
> +
> +	/* allocate txschq queue */
> +	new_cfg = kzalloc(sizeof(*new_cfg), GFP_KERNEL);
> +	if (!new_cfg) {
> +		NL_SET_ERR_MSG_MOD(extack, "Memory allocation error");

Here the root node is leaked.

> +		mutex_destroy(&pfvf->qos.qos_lock);
> +		return -ENOMEM;
> +	}


[...]

Cheers,

Paolo


  reply	other threads:[~2023-03-28 10:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 18:12 [net-next Patch v5 0/6] octeontx2-pf: HTB offload support Hariprasad Kelam
2023-03-26 18:12 ` [net-next Patch v5 1/6] sch_htb: Allow HTB priority parameter in offload mode Hariprasad Kelam
2023-03-28 14:44   ` Simon Horman
2023-03-26 18:12 ` [net-next Patch v5 2/6] octeontx2-pf: Rename tot_tx_queues to non_qos_queues Hariprasad Kelam
2023-03-28 14:44   ` Simon Horman
2023-03-26 18:12 ` [net-next Patch v5 3/6] octeontx2-pf: qos send queues management Hariprasad Kelam
2023-03-28 14:43   ` Simon Horman
2023-03-29 17:19     ` Hariprasad Kelam
2023-03-26 18:12 ` [net-next Patch v5 4/6] octeontx2-pf: Refactor schedular queue alloc/free calls Hariprasad Kelam
2023-03-28 14:44   ` Simon Horman
2023-03-26 18:12 ` [net-next Patch v5 5/6] octeontx2-pf: Add support for HTB offload Hariprasad Kelam
2023-03-28 10:56   ` Paolo Abeni [this message]
2023-03-29 16:44     ` Hariprasad Kelam
2023-03-28 14:41   ` Simon Horman
2023-03-29 17:17     ` Hariprasad Kelam
2023-03-28 18:42   ` Maxim Mikityanskiy
2023-03-29 18:03     ` Hariprasad Kelam
2023-03-26 18:12 ` [net-next Patch v5 6/6] docs: octeontx2: Add Documentation for QOS Hariprasad Kelam
2023-03-28 14:45   ` Simon Horman

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=e6b7c24026e3750ea3e10a5ebf26bf2dd903e2a1.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxtram95@gmail.com \
    --cc=naveenm@marvel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xiyou.wangcong@gmail.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®