OSDN Git Service

net: davicom: Fix regulator not turned off on failed probe
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 11 Apr 2021 09:02:08 +0000 (11:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Apr 2021 23:53:58 +0000 (16:53 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/davicom/dm9000.c

index 252adfa..8a9096a 100644 (file)
@@ -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);