diff mbox series

net: davicom: Fix regulator not turned off on failed probe

Message ID 88d396a107aad8059cabc3eb1f05f7d325287bf2.1618131620.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series net: davicom: Fix regulator not turned off on failed probe | expand

Commit Message

Christophe JAILLET April 11, 2021, 9:02 a.m. UTC
When the probe fails, we must disable the regulator that was previously
enabled.

This patch is a follow-up to commit ac88c531a5b3
("net: davicom: Fix regulator not turned off on failed probe") which missed
one case.

Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/davicom/dm9000.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 12, 2021, midnight UTC | #1
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 11 Apr 2021 11:02:08 +0200 you wrote:
> When the probe fails, we must disable the regulator that was previously
> enabled.
> 
> This patch is a follow-up to commit ac88c531a5b3
> ("net: davicom: Fix regulator not turned off on failed probe") which missed
> one case.
> 
> [...]

Here is the summary with links:
  - net: davicom: Fix regulator not turned off on failed probe
    https://git.kernel.org/netdev/net/c/31457db3750c

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

Patch

diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 252adfa5d837..8a9096aa85cd 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1471,8 +1471,10 @@  dm9000_probe(struct platform_device *pdev)
 
 	/* Init network device */
 	ndev = alloc_etherdev(sizeof(struct board_info));
-	if (!ndev)
-		return -ENOMEM;
+	if (!ndev) {
+		ret = -ENOMEM;
+		goto out_regulator_disable;
+	}
 
 	SET_NETDEV_DEV(ndev, &pdev->dev);