From patchwork Mon Apr 19 13:06:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 425146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DDDEC43600 for ; Mon, 19 Apr 2021 13:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B70161246 for ; Mon, 19 Apr 2021 13:25:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241189AbhDSN0V (ORCPT ); Mon, 19 Apr 2021 09:26:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:34120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242073AbhDSNZR (ORCPT ); Mon, 19 Apr 2021 09:25:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8BFB613C3; Mon, 19 Apr 2021 13:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838430; bh=5PdlYBCQRXh8R1ZMwsq3eOnFfBzYLuVR7QvIuC8M/jE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z3O4L3WDiFiWq/o9g6iHwC7qZ1FzCN63dEtxQNBAcXoX936ah1HuB4CC99mHZ3mub 6NcCQD//ZTmgbbP6O4JN2tM0w0FgYUVRRInfXxTMiDUtnTuguNsPt4MjG80Ccm3YRO /ukK85u9QtseCIIFxgFSF0XNv/WyHFUH9cVg+kMk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "David S. Miller" Subject: [PATCH 5.4 56/73] net: davicom: Fix regulator not turned off on failed probe Date: Mon, 19 Apr 2021 15:06:47 +0200 Message-Id: <20210419130525.641004020@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130523.802169214@linuxfoundation.org> References: <20210419130523.802169214@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET 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 --- drivers/net/ethernet/davicom/dm9000.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -1476,8 +1476,10 @@ dm9000_probe(struct platform_device *pde /* 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);