Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Carolina Jubran <cjubran@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	Cosmin Ratiu <cratiu@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
	Arnd Bergmann <arnd@arndb.de>, Joe Damato <jdamato@fastly.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] devlink: move DEVLINK_ATTR_MAX-sized array off stack
Date: Wed, 9 Jul 2025 11:03:01 +0100	[thread overview]
Message-ID: <20250709100301.GS452973@horms.kernel.org> (raw)
In-Reply-To: <20250708160652.1810573-1-arnd@kernel.org>

On Tue, Jul 08, 2025 at 06:06:43PM +0200, Arnd Bergmann wrote:

...

> diff --git a/net/devlink/rate.c b/net/devlink/rate.c

...

> +	err = -EINVAL;

...

>  	tc_bw[tc_index] = nla_get_u32(tb[DEVLINK_ATTR_RATE_TC_BW]);
>  
> -	return 0;

Hi Arnd,

It looks like err will be -EINVAL here, which doesn't seem desirable.
I'd just return 0 here.

And, FWIIW, I'd only set err when it is needed, even if that
means some duplication. I think that is an idiomatic approach,
at least within Networking.

> +out:
> +	kfree(tb);
> +	return err;
>  }

...

-- 
pw-bot: changes-requested

  reply	other threads:[~2025-07-09 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 16:06 [PATCH] devlink: move DEVLINK_ATTR_MAX-sized array off stack Arnd Bergmann
2025-07-09 10:03 ` Simon Horman [this message]
2025-07-09 10:05 ` Jiri Pirko
2025-07-09 15:09   ` Arnd Bergmann

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=20250709100301.GS452973@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=cjubran@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdamato@fastly.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=tariqt@nvidia.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