All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Dan Carpenter <error27@gmail.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG
Date: Thu, 8 Dec 2022 11:01:17 +0200	[thread overview]
Message-ID: <Y5Gn3Yb3nLgsbcFN@shredder> (raw)
In-Reply-To: <Y5Cci6U4sb4hYNUL@kili>

Hi,

Thanks for the report.

On Wed, Dec 07, 2022 at 05:00:43PM +0300, Dan Carpenter wrote:
> Hello Ido Schimmel,
> 
> The patch 31e1de4f1242: "mlxsw: spectrum: Apply RIF configuration
> when joining a LAG" from Dec 6, 2020, leads to the following Smatch
> static checker warning:
> 
> 	drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:8546 mlxsw_sp_port_vlan_router_join()
> 	warn: missing error code here? 'mlxsw_sp_rif_find_by_dev()' failed. 'err' = '0'
> 
> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>     8534 int
>     8535 mlxsw_sp_port_vlan_router_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan,
>     8536                                struct net_device *l3_dev,
>     8537                                struct netlink_ext_ack *extack)
>     8538 {
>     8539         struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port_vlan->mlxsw_sp_port->mlxsw_sp;
>     8540         struct mlxsw_sp_rif *rif;
>     8541         int err = 0;
>     8542 
>     8543         mutex_lock(&mlxsw_sp->router->lock);
>     8544         rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev);
>     8545         if (!rif)
> --> 8546                 goto out;
>                          ^^^^^^^^
> Is this an error path?

No, it's valid to not have a RIF. See the comment in the caller of this
function:

/* Join a router interface configured on the LAG, if exists */
err = mlxsw_sp_port_vlan_router_join(mlxsw_sp_port->default_vlan,
				     lag_dev, extack);

> 
>     8547 
>     8548         err = __mlxsw_sp_port_vlan_router_join(mlxsw_sp_port_vlan, l3_dev,
>     8549                                                extack);
>     8550 out:
>     8551         mutex_unlock(&mlxsw_sp->router->lock);
>     8552         return err;
>     8553 }
> 
> regards,
> dan carpenter

      reply	other threads:[~2022-12-08  9:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 14:00 [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG Dan Carpenter
2022-12-08  9:01 ` Ido Schimmel [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=Y5Gn3Yb3nLgsbcFN@shredder \
    --to=idosch@nvidia.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.