[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e83ff2bd-1f29-4aa9-bb66-4f06a73867ac@gmail.com>
Date: Wed, 9 Apr 2025 17:16:18 +0300
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Charles Han <hanchunchao@...pur.com>, saeedm@...dia.com, leon@...nel.org,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, lariel@...dia.com, paulb@...dia.com,
maord@...dia.com, Henry Martin <bsdhenrymartin@...il.com>
Cc: netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH V2] net/mlx5e: fix potential null dereference in
mlx5e_tc_nic_create_miss_table
On 07/04/2025 10:20, Charles Han wrote:
> mlx5_get_flow_namespace() may return a NULL pointer, dereferencing it
> without NULL check may lead to NULL dereference.
> Add a NULL check for ns.
>
> Fixes: 66cb64e292d2 ("net/mlx5e: TC NIC mode, fix tc chains miss table")
> Signed-off-by: Charles Han <hanchunchao@...pur.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> index 9ba99609999f..c2f23ac95c3d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> @@ -5216,6 +5216,10 @@ static int mlx5e_tc_nic_create_miss_table(struct mlx5e_priv *priv)
> ft_attr.level = MLX5E_TC_MISS_LEVEL;
> ft_attr.prio = 0;
> ns = mlx5_get_flow_namespace(priv->mdev, MLX5_FLOW_NAMESPACE_KERNEL);
> + if (!ns) {
> + netdev_err(priv->mdev, "Failed to get flow namespace\n");
> + return -EOPNOTSUPP;
> + }
>
> *ft = mlx5_create_auto_grouped_flow_table(ns, &ft_attr);
> if (IS_ERR(*ft)) {
Too many similar patches submitted individually in parallel by multiple
authors..
One can easily lose track.
Please gather similar patches in a series, provide cover letter and
target branch.
Tariq.
Powered by blists - more mailing lists