From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Charles Han <hanchunchao@inspur.com>,
saeedm@nvidia.com, leon@kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, roid@nvidia.com, jianbol@nvidia.com
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH] net/mlx5: Add NULL check in mlx5e_tc_nic_create_miss_table
Date: Tue, 20 May 2025 14:14:15 +0300 [thread overview]
Message-ID: <bb12f21b-8b36-4fd8-80a7-4a25221f6d18@gmail.com> (raw)
In-Reply-To: <20250519112747.12365-1-hanchunchao@inspur.com>
For EN driver changes, please use net/mlx5e prefix.
On 19/05/2025 14:27, Charles Han wrote:
> The mlx5e_tc_nic_create_miss_table() function did not check the
> return value of mlx5_get_flow_namespace(). This could lead to
> subsequent code using an invalid flow namespace pointer,
> potentially causing crashes or undefined behavior.
>
> Fixes: 794131c40850 ("net/mlx5: E-Switch, Return EBUSY if can't get mode lock")
Tagged commit doesn't seem related.
> Signed-off-by: Charles Han <hanchunchao@inspur.com>
> ---
Explicitly mention target branch, and add the netdev mailing list.
> 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 f1d908f61134..81f0db29a2bb 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> @@ -5213,6 +5213,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) {
> + mlx5_core_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)) {
prev parent reply other threads:[~2025-05-20 11:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 11:27 Charles Han
2025-05-20 11:14 ` Tariq Toukan [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=bb12f21b-8b36-4fd8-80a7-4a25221f6d18@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hanchunchao@inspur.com \
--cc=jianbol@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roid@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®