lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87fs2oqc0u.fsf@nvidia.com>
Date: Fri, 6 Oct 2023 12:19:43 +0200
From: Petr Machata <petrm@...dia.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Ido Schimmel <idosch@...lanox.com>, Ido Schimmel <idosch@...dia.com>,
	"Petr Machata" <petrm@...dia.com>, "David S. Miller" <davem@...emloft.net>,
	"Eric Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>, <netdev@...r.kernel.org>,
	<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net] mlxsw: fix mlxsw_sp2_nve_vxlan_learning_set()
 return type


Dan Carpenter <dan.carpenter@...aro.org> writes:

> The mlxsw_sp2_nve_vxlan_learning_set() function is supposed to return
> zero on success or negative error codes.  So it needs to be type int
> instead of bool.

Yes. Vast majority of the time the error code is 0, which converts to
false, which converts back to 0. But for errors this gets sliced to 1,
which eventually percolates to notifier_from_errno(), which yields
NOTIFY_STOP_MASK | NOTIFY_DONE instead of encoding the error code,
masking the failure.

> Fixes: 4ee70efab68d ("mlxsw: spectrum_nve: Add support for VXLAN on Spectrum-2")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>

Reviewed-by: Petr Machata <petrm@...dia.com>

Thanks!

> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> index bb8eeb86edf7..52c2fe3644d4 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> @@ -310,8 +310,8 @@ const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
>  	.fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload,
>  };
>  
> -static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
> -					     bool learning_en)
> +static int mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
> +					    bool learning_en)
>  {
>  	char tnpc_pl[MLXSW_REG_TNPC_LEN];


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ