diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2021-04-11 11:02:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-11 16:53:58 -0700 |
commit | 31457db3750c0b0ed229d836f2609fdb8a5b790e (patch) | |
tree | a320289be744067b1abce39fb05309a92a597160 /drivers/net/ethernet/davicom | |
parent | 4af2178ac605faf32ebe638f7ac17d841d40ea9b (diff) |
net: davicom: Fix regulator not turned off on failed probe
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>
Diffstat (limited to 'drivers/net/ethernet/davicom')
-rw-r--r-- | drivers/net/ethernet/davicom/dm9000.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |