public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Boris Pismenny <borisp@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	"Mark Bloch" <mbloch@nvidia.com>,
	Daniel Zahka <daniel.zahka@gmail.com>,
	"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
	Cosmin Ratiu <cratiu@nvidia.com>, Raed Salem <raeds@nvidia.com>,
	Rahul Rameshbabu <rrameshbabu@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>, Kees Cook <kees@kernel.org>,
	<netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Gal Pressman <gal@nvidia.com>
Subject: Re: [PATCH net V3 1/3] net/mlx5e: psp: Fix invalid access on PSP dev registration fail
Date: Tue, 5 May 2026 19:11:15 -0700	[thread overview]
Message-ID: <20260505191115.3504d797@kernel.org> (raw)
In-Reply-To: <20260504181100.269334-2-tariqt@nvidia.com>

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 :\

  reply	other threads:[~2026-05-06  2:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 18:10 [PATCH net V3 0/3] net/mlx5e: PSP fixes Tariq Toukan
2026-05-04 18:10 ` [PATCH net V3 1/3] net/mlx5e: psp: Fix invalid access on PSP dev registration fail Tariq Toukan
2026-05-06  2:11   ` Jakub Kicinski [this message]
2026-05-04 18:10 ` [PATCH net V3 2/3] net/mlx5e: psp: Expose only a fully initialized priv->psp Tariq Toukan
2026-05-04 18:11 ` [PATCH net V3 3/3] net/mlx5e: psp: Hook PSP dev reg/unreg to profile enable/disable Tariq Toukan
2026-05-06  2:20 ` [PATCH net V3 0/3] net/mlx5e: PSP fixes patchwork-bot+netdevbpf

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=20260505191115.3504d797@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kees@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raeds@nvidia.com \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=willemdebruijn.kernel@gmail.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