stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] can: tcan4x5x: fix power regulator retrieval during probe
       [not found] <20250617155123.2141584-1-mkl@pengutronix.de>
@ 2025-06-17 15:50 ` Marc Kleine-Budde
  2025-06-17 23:00   ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2025-06-17 15:50 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Brett Werling, stable,
	Marc Kleine-Budde

From: Brett Werling <brett.werling@garmin.com>

Fixes the power regulator retrieval in tcan4x5x_can_probe() by ensuring
the regulator pointer is not set to NULL in the successful return from
devm_regulator_get_optional().

Fixes: 3814ca3a10be ("can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config")
Signed-off-by: Brett Werling <brett.werling@garmin.com>
Link: https://patch.msgid.link/20250612191825.3646364-1-brett.werling@garmin.com
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/tcan4x5x-core.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c
index e5c162f8c589..8edaa339d590 100644
--- a/drivers/net/can/m_can/tcan4x5x-core.c
+++ b/drivers/net/can/m_can/tcan4x5x-core.c
@@ -411,10 +411,11 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
 	priv = cdev_to_priv(mcan_class);
 
 	priv->power = devm_regulator_get_optional(&spi->dev, "vsup");
-	if (PTR_ERR(priv->power) == -EPROBE_DEFER) {
-		ret = -EPROBE_DEFER;
-		goto out_m_can_class_free_dev;
-	} else {
+	if (IS_ERR(priv->power)) {
+		if (PTR_ERR(priv->power) == -EPROBE_DEFER) {
+			ret = -EPROBE_DEFER;
+			goto out_m_can_class_free_dev;
+		}
 		priv->power = NULL;
 	}
 

base-commit: 7b4ac12cc929e281cf7edc22203e0533790ebc2b
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] can: tcan4x5x: fix power regulator retrieval during probe
  2025-06-17 15:50 ` [PATCH net] can: tcan4x5x: fix power regulator retrieval during probe Marc Kleine-Budde
@ 2025-06-17 23:00   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-17 23:00 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: netdev, davem, kuba, linux-can, kernel, brett.werling, stable

Hello:

This patch was applied to netdev/net.git (main)
by Marc Kleine-Budde <mkl@pengutronix.de>:

On Tue, 17 Jun 2025 17:50:02 +0200 you wrote:
> From: Brett Werling <brett.werling@garmin.com>
> 
> Fixes the power regulator retrieval in tcan4x5x_can_probe() by ensuring
> the regulator pointer is not set to NULL in the successful return from
> devm_regulator_get_optional().
> 
> Fixes: 3814ca3a10be ("can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config")
> Signed-off-by: Brett Werling <brett.werling@garmin.com>
> Link: https://patch.msgid.link/20250612191825.3646364-1-brett.werling@garmin.com
> Cc: stable@vger.kernel.org
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> [...]

Here is the summary with links:
  - [net] can: tcan4x5x: fix power regulator retrieval during probe
    https://git.kernel.org/netdev/net/c/db2272054520

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-17 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250617155123.2141584-1-mkl@pengutronix.de>
2025-06-17 15:50 ` [PATCH net] can: tcan4x5x: fix power regulator retrieval during probe Marc Kleine-Budde
2025-06-17 23:00   ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).