Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3410259pxy; Mon, 26 Apr 2021 00:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpJ0gYB6xFwOpLXjG/Wx5HXgukwuymQQJa/bTMTkYGb+OIimCJZF1SrtsSHuiotltqIh+I X-Received: by 2002:a17:90a:304e:: with SMTP id q14mr4041823pjl.55.1619423012852; Mon, 26 Apr 2021 00:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619423012; cv=none; d=google.com; s=arc-20160816; b=lAZHA1lV0zcX1KwK2yIX83q1gtb7MiiB2j+Qhp1gsCEkck8GRzrgmVR15Sm8Iz9YPy 2u/M5aGQb10UPba9OBdwGr6pcG+D3ewUMArpz3LP83jk0Jie9UdrYYtaZ2IWsmS1MUUs I0ZINL6hFq4j0liQlAtqpx4NcRLy/6eOJ4bufkGZz7eRKiVMPJAKkE3jOHah+D+QBYZt ybsP589ec3TNeOahArqn/l/8ZlHC53uobZzHA0wwyOXmwJYK/uKZq4p5ibtnBtJIFec8 tNFA+ouosSUEqOVZK6pIVI+nj94lVz3WG7NEPkbQrMqft57LDYiHFIuEOS99Dn0q7QS+ imrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OCOCiVNt3W6OukRCoFmXKv2s6JZ8WKQ9E3vjOxVjuk0=; b=ZCPt5KBNQ3NstUv40h7N4cP7XlK3dBQ0xbeyecv4AAk38MP5UgZF/EOkB4caeYEfOh te7Ut/gh/BcTWxhJQXwoGtaAq0zTPzOtrbeQfRWITrPISoTdHRctGPnzApd/YapIyTOh HBoKC5GaMTlkX1GMrTDbRyeJX2ovFTUbHMDYAbCgLgCYXSP786/5nJz4wFMhOJcVAple V5q6WyNetl1wxhEdLjBiVgdN4nP88hmBnkhqE1dFfrJ2DJhB+SZFaNjBTU/iUdGAq+Gu mrArA44bHLIswVBuknEGVVIWfIuGF6FJLKW03b9W9A/kd2w9+CqeoRGwcx/KdvGdVi7i i2xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xV3qCIza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si16946916pjp.103.2021.04.26.00.43.20; Mon, 26 Apr 2021 00:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xV3qCIza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232299AbhDZHl6 (ORCPT + 99 others); Mon, 26 Apr 2021 03:41:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:46432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232597AbhDZHh1 (ORCPT ); Mon, 26 Apr 2021 03:37:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3BEA61152; Mon, 26 Apr 2021 07:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422533; bh=EvIaBCVx7dtkWEt7kx0Hmxu09OHgaBoPE8ereCmAfTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xV3qCIza86A45DiXFsutDp7ShTV/aPJNEJB/rYE413hpUnxQvyjiSw7E780M+zMdd zrYDAwLgUV4lHDUAYwG6Zp1Puo8noxVgFq5w8OmXJ9R53A/6S/CHhHuYH8cDuCyOsZ Izvq/EwHJG3BqMpFYsecOn23kkjRMMPKTReFIOko= 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 4.14 28/49] net: davicom: Fix regulator not turned off on failed probe Date: Mon, 26 Apr 2021 09:29:24 +0200 Message-Id: <20210426072820.683039418@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072819.721586742@linuxfoundation.org> References: <20210426072819.721586742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -1482,8 +1482,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);