mlxsw: spectrum_router: Avoid missing error code warning
authorIdo Schimmel <idosch@OSS.NVIDIA.COM>
Mon, 17 May 2021 17:03:59 +0000 (20:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 May 2021 22:15:46 +0000 (15:15 -0700)
commit51746a353b44f9e2635ebbe278c46b2d9303c9d9
tree2ff98e34aa9e6837a5d6ceef03c44fd067d12bf7
parent8c2b58e65d0186af5f73c7b78e46b798166d7f68
mlxsw: spectrum_router: Avoid missing error code warning

Explicitly set the error code to zero before the goto statement to avoid
the following smatch warning:

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3598 mlxsw_sp_nexthop_group_refresh() warn: missing error code 'err'

The warning is a false positive, but the change both suppresses the
warning and makes it clear to future readers that this is not an error
path.

The original report and discussion can be found here [1].

[1] https://lore.kernel.org/lkml/202105141823.Td2h3Mbi-lkp@intel.com/

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c