From: Christophe JAILLET Date: Sun, 11 Apr 2021 09:02:08 +0000 (+0200) Subject: net: davicom: Fix regulator not turned off on failed probe X-Git-Tag: v4.19.189~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb45f588b087d87645e7b6a938b2fe65a91acd02;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index a339ea2fd4961..8b07890b0b232 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -1482,8 +1482,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);