[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240607112628.igcf6ytqe6wbmbq5@skbuf>
Date: Fri, 7 Jun 2024 14:26:28 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Martin Schiller <ms@....tdt.de>
Cc: martin.blumenstingl@...glemail.com, hauke@...ke-m.de, andrew@...n.ch,
f.fainelli@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 09/13] net: dsa: lantiq_gswip: Forbid
gswip_add_single_port_br on the CPU port
On Thu, Jun 06, 2024 at 10:52:30AM +0200, Martin Schiller wrote:
> From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
>
> Calling gswip_add_single_port_br() with the CPU port would be a bug
> because then only the CPU port could talk to itself. Add the CPU port to
> the validation at the beginning of gswip_add_single_port_br().
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> ---
> drivers/net/dsa/lantiq_gswip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
> index ee8296d5b901..d2195271ffe9 100644
> --- a/drivers/net/dsa/lantiq_gswip.c
> +++ b/drivers/net/dsa/lantiq_gswip.c
> @@ -657,7 +657,7 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add)
> unsigned int max_ports = priv->hw_info->max_ports;
> int err;
>
> - if (port >= max_ports) {
> + if (port >= max_ports || dsa_is_cpu_port(priv->ds, port)) {
> dev_err(priv->dev, "single port for %i supported\n", port);
> return -EIO;
> }
> --
> 2.39.2
>
Isn't the new check effectively dead code?
Powered by blists - more mailing lists