Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2020346pxa; Mon, 3 Aug 2020 05:34:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxquJ3w5PDfJsK5BJqksk7XXVGCCiFAvnngh1NGTK7Rfs+XhH3tBI17Ch+DG5Mnn9BK6S72 X-Received: by 2002:a17:906:3b01:: with SMTP id g1mr17224938ejf.353.1596458050495; Mon, 03 Aug 2020 05:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596458050; cv=none; d=google.com; s=arc-20160816; b=EezlHGD7Sp+p7+6FM5KYL4OclAXWz7JeonaH1min2g9/31gn/mZ1Dx1sPrVR+tF4Fn sMI69o2vHTPN66qW/EE7y3TCqE9TB3ict8iOQBPH8LmhnaQmyAjFYUELn6IBsvwdNFWs wZfg6vEUDXdpT8NXaAQaCO4uaYvrIAhCoODozntE+dhU+V0aEZa5Q3up5/JZWL5GjL7w +e6Uy+LT1dz/8EaRapoQE2dQK7MWXLYyNSUctbWEGhIXW9nO5ad1nc65cC8a4qaSznvr sZNLjDk/Ax0MMHmcripVL6so2gpevgFjKZskirXFA9dD4eDJgovG+y6WbKLsasdIWvbn gGTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tJlzu3zm9CubjRZD5QaYJ7ka6Mcsj8Jtu5dSPL0I0xE=; b=p6vfphVl8GdDcCDA0igAOqQUtR+XCn5bKsRw14Ofgq4fxaiSZq3aAQnyNccKGMmvrw TlTzdUhbUJcKtQXfB/yd5KvnC55OTHMBL+cd09JRWzjgkNeDem49Mc10d3FLiBL1OtkW 1k9p7d48brXJBFUM2s+egXqYWsFeK+rjBpmZEaZ8Qmy9kihi+EpNz95LgdGPiQHENSVv 8t48vqtcQ4Dxawlzk3xoEYfPR7TGMC6DEr+uHLJOJPlwDf6OofJhWwFfCcQNzz01oMLK fFBh2Q6HJli325OqSPWdW+3SIj3JxgPgS5/sb//BMa5cHvnthbQEIJzA0iEJsvnyL0p+ xHDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=paEQsDsL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si10438805edw.303.2020.08.03.05.33.48; Mon, 03 Aug 2020 05:34:10 -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=@kernel.org header.s=default header.b=paEQsDsL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729349AbgHCMcq (ORCPT + 99 others); Mon, 3 Aug 2020 08:32:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:60648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729337AbgHCMcl (ORCPT ); Mon, 3 Aug 2020 08:32:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 977772076B; Mon, 3 Aug 2020 12:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596457960; bh=VIHMX9KfMBPg8/pWyGq9IW87rpE2ocGo68sX2lLBjPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paEQsDsL4Bf+L0SjptwYAebfrAuaB5blxJDBfg5q1yK5nAZYCw47LdFKbnNNHEw+s s7eCStz0zS80NhwCzMTRnXI4jKKE3cXsS8o12IGHj+RYHpBv91fFyjGblXiEwcZ2wo 39Xjg594e0kzagTCcRJVbwXg65GN38OhtAXTbeZk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Hai , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 44/56] net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe() Date: Mon, 3 Aug 2020 14:19:59 +0200 Message-Id: <20200803121852.465245070@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121850.306734207@linuxfoundation.org> References: <20200803121850.306734207@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Hai [ Upstream commit 85496a29224188051b6135eb38da8afd4c584765 ] Fix the missing clk_disable_unprepare() before return from gemini_ethernet_port_probe() in the error handling case. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cortina/gemini.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 01a2120978360..f402af39da42a 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -2451,6 +2451,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) port->reset = devm_reset_control_get_exclusive(dev, NULL); if (IS_ERR(port->reset)) { dev_err(dev, "no reset\n"); + clk_disable_unprepare(port->pclk); return PTR_ERR(port->reset); } reset_control_reset(port->reset); @@ -2506,8 +2507,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) IRQF_SHARED, port_names[port->id], port); - if (ret) + if (ret) { + clk_disable_unprepare(port->pclk); return ret; + } ret = register_netdev(netdev); if (!ret) { -- 2.25.1