[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709100301.GS452973@horms.kernel.org>
Date: Wed, 9 Jul 2025 11:03:01 +0100
From: Simon Horman <horms@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Jiri Pirko <jiri@...nulli.us>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Carolina Jubran <cjubran@...dia.com>,
Tariq Toukan <tariqt@...dia.com>, Cosmin Ratiu <cratiu@...dia.com>,
Mark Bloch <mbloch@...dia.com>, Arnd Bergmann <arnd@...db.de>,
Joe Damato <jdamato@...tly.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] devlink: move DEVLINK_ATTR_MAX-sized array off stack
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
Powered by blists - more mailing lists