Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2467252pxb; Mon, 19 Apr 2021 06:28:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWkXYAaZ4oa/GQZpdUfIbXjzVlLJWuTNgQQmyML9qstNJbowC4X1UM93ioeYDJip9jy4vZ X-Received: by 2002:a17:906:c9d8:: with SMTP id hk24mr22608464ejb.480.1618838935129; Mon, 19 Apr 2021 06:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618838935; cv=none; d=google.com; s=arc-20160816; b=ZqqslpOu9cRI1CX62+rThQSoENqw1r4z5ZMBJx3sj0Fe/4mHQJWL2vp6P3xDrrw9uI Bwlym/ISsWx8yJADwGHz8xpbWXu5W412GejG8UpoPmxf7z6whgtdGK9NGX0O826TUeJx E3g6BUcZyXXaKmWb7dBGQUSe8wUH9m+urNVeKm2nulof/LnW5aiBWBCDWy3dWtG5MNhB F7hf8MBK5uHk83EeFsB58MOuJ948xvrXuHZKpECk/iGsRne9URt99yGYoSgIFSr273Ez QjZVJTefOXHBNxJhuXaP6RVkTQSgpXIFAI9aHO7q3RkiDrLz63hhkPfHJiObvRx9mgBl fcsQ== 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=AkcjNM0Auj4oU1ean8JUiqvnj+tY2WpjrVJDEKGIctA=; b=iKkxuND5HM0YsUIKl/sjroCz+GwtuL5Z62SNqFaKGG7+/by2agdWxyB7B7LhaeZTsR fZWtdW+kp2gLvdgE9P5wr8Mnfy16sq/y4fXDaAAKfQWOXoxaXWEpiRZtXjY1mqrzqv7H k21fCjmnvmouomZtS9FHUeCkjOkLZF1BreCqzS84uqjvJTGNGEAuz6J+CC6YwWPotTxn NPj+tZcidKFSO6TC5BhQvMzvVhoMUfYAlKAP3Ns58Z5lAr4ZkOOdIOsCddAWmGdr/9b5 djSWOLlhBLx7wz5nJ6zwR6thDY9rF8V/yCTiQjwdgXM4mEolqYu+51TdtpOK0m1nYXdk EG/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X7WhMPHR; 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 hs11si13939856ejc.429.2021.04.19.06.28.30; Mon, 19 Apr 2021 06:28:55 -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=X7WhMPHR; 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 S242313AbhDSN1L (ORCPT + 99 others); Mon, 19 Apr 2021 09:27:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241327AbhDSNU0 (ORCPT ); Mon, 19 Apr 2021 09:20:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BEC761363; Mon, 19 Apr 2021 13:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838177; bh=MemWX/XZ/BxlCqrtI7r2iibDGG5fUEyWMFYJQH4/ZbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7WhMPHR3HMACLDG5NSxk9jCMYXY2y0e14HIXWHAlowWLu6JDyhVDthQJZS2TNa3O ixoHXAYv+WWaszmp6MnQS+F53PeLvyZTWB1xwSQPxundp4nsh+HceaQv62hBIFQQAA ej0+FJX5QgwaYBBrmzcbKsEoKgWeXN0Z4c8WNx+8= 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.10 069/103] net: davicom: Fix regulator not turned off on failed probe Date: Mon, 19 Apr 2021 15:06:20 +0200 Message-Id: <20210419130530.194641907@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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 @@ -1474,8 +1474,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);