[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f94e54b8-6366-b782-5e4d-d18aba464e1e@intel.com>
Date: Mon, 28 Nov 2022 15:26:55 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Saeed Mahameed <saeed@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>
CC: Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
Tariq Toukan <tariqt@...dia.com>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [net 06/15] net/mlx5e: Fix a couple error codes
On 11/24/2022 12:10 AM, Saeed Mahameed wrote:
> From: Dan Carpenter <dan.carpenter@...cle.com>
>
> If kvzalloc() fails then return -ENOMEM. Don't return success.
>
Makes sense.
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Fixes: 3b20949cb21b ("net/mlx5e: Add MACsec RX steering rules")
> Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
> ---
> .../ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
> index 1ac0cf04e811..96cec6d826c2 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
> @@ -250,7 +250,7 @@ static int macsec_fs_tx_create(struct mlx5e_macsec_fs *macsec_fs)
> struct mlx5_flow_handle *rule;
> struct mlx5_flow_spec *spec;
> u32 *flow_group_in;
> - int err = 0;
> + int err;
>
> ns = mlx5_get_flow_namespace(macsec_fs->mdev, MLX5_FLOW_NAMESPACE_EGRESS_MACSEC);
> if (!ns)
> @@ -261,8 +261,10 @@ static int macsec_fs_tx_create(struct mlx5e_macsec_fs *macsec_fs)
> return -ENOMEM;
>
> flow_group_in = kvzalloc(inlen, GFP_KERNEL);
> - if (!flow_group_in)
> + if (!flow_group_in) {
> + err = -ENOMEM;
> goto out_spec;
> + }
>
> tx_tables = &tx_fs->tables;
> ft_crypto = &tx_tables->ft_crypto;
> @@ -898,7 +900,7 @@ static int macsec_fs_rx_create(struct mlx5e_macsec_fs *macsec_fs)
> struct mlx5_flow_handle *rule;
> struct mlx5_flow_spec *spec;
> u32 *flow_group_in;
> - int err = 0;
> + int err;
>
> ns = mlx5_get_flow_namespace(macsec_fs->mdev, MLX5_FLOW_NAMESPACE_KERNEL_RX_MACSEC);
> if (!ns)
> @@ -909,8 +911,10 @@ static int macsec_fs_rx_create(struct mlx5e_macsec_fs *macsec_fs)
> return -ENOMEM;
>
> flow_group_in = kvzalloc(inlen, GFP_KERNEL);
> - if (!flow_group_in)
> + if (!flow_group_in) {
> + err = -ENOMEM;
> goto free_spec;
> + }
>
> rx_tables = &rx_fs->tables;
> ft_crypto = &rx_tables->ft_crypto;
Powered by blists - more mailing lists