Re: [PATCH] net/mlx5: Fix null-ptr-deref in mlx5_create_inner_ttc_table()

From: Markus Elfring
Date: Tue Apr 08 2025 - 08:34:55 EST



> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c
> > @@ -655,6 +655,8 @@ struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev,
> > }
> >
> > ns = mlx5_get_flow_namespace(dev, params->ns_type);
> > + if (!ns)
> > + return ERR_PTR(-EOPNOTSUPP);
>
> I suspect the ns_type the caller always sets a valid 'ns_type', so the
> NULL ptr is not really possible here.

Is there a need to mark such a check result as “unlikely”?

Regards,
Markus