summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/davicom/dm9000.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-04-11 12:02:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-21 14:00:57 +0300
commit154ac84d497aa30459e39af4111dd45100759806 (patch)
tree0136e4d9d00464b9a4bc0084dd4b0fe0b7e6879f /drivers/net/ethernet/davicom/dm9000.c
parente072247938a8551187f1ad3f9f928d968c96fd0c (diff)
downloadlinux-154ac84d497aa30459e39af4111dd45100759806.tar.xz
net: davicom: Fix regulator not turned off on failed probe
commit 31457db3750c0b0ed229d836f2609fdb8a5b790e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/davicom/dm9000.c')
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index ae09cac87602..afc4a103c508 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1474,8 +1474,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);