Re: [PATCH net V3 1/3] net/mlx5e: psp: Fix invalid access on PSP dev registration fail

From: Jakub Kicinski

Date: Tue May 05 2026 - 22:11:22 EST


On Mon, 4 May 2026 21:10:58 +0300 Tariq Toukan wrote:
> - if (!priv->psp || !priv->psp->psp)
> + struct mlx5e_psp *psp = priv->psp;
> +
> + if (!psp || !psp->psp)
> return;
>
> - psp_dev_unregister(priv->psp->psp);
> + psp_dev_unregister(psp->psp);
> + psp->psp = NULL;

TBH the pointless churn to add a local variable here was what I was
referring to when talking about unnecessary refactoring. One line
change to clear the pointer and you're turning it to a full rewrite
of the helper.

Whatever. Some things can't be taught I guess :\