Received: by 10.223.185.116 with SMTP id b49csp1098284wrg; Fri, 23 Feb 2018 11:54:56 -0800 (PST) X-Google-Smtp-Source: AH8x224L6V8bvUGThfsuuvidkBeGsmtJDDmTK8ZQ4d326mH1aztVdOIF87vWXmF1zz7saQn5uQYY X-Received: by 10.98.97.198 with SMTP id v189mr2865739pfb.110.1519415696106; Fri, 23 Feb 2018 11:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415696; cv=none; d=google.com; s=arc-20160816; b=dUonGLgXJ4b/68fovxHqzJdpj4MhKQeYI+tsnCfSOLQQNS96gR6yDtwsDCOpnM8woy 2VdGzDgHq5RYtf8DrOA787cZf3BwgoG0t6RwF2QhOcR8zu5QutgdJ8PND6bBOEkvWr/9 yfgaqEohUDnC9iwcRy6XZHvjGr4tV1eVz37W4aIX/fz/mT6ZyiMYFaJYGhidT520Bdnn 9ZJJjskUZ/7uDkjtEpchYAU46Fz6Uq5HgZ4mqVbBAl4TDd3ay6eH1B829iAl+N9phb8a PEu+Y0NxmXbRY+RqoVPhCm3mBKnNjx/nq+zuf5rTKBcjtmmMg1hqFpP0gh6r/joeKKQ0 hyIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=81//qKzh2bv1IjVOJupSF/LS5QdIAiqV0FP6kux6bGA=; b=rWmLoh4LCLVAfysACH0/e0uW/EVG0U1MadLFm40Xz7TUN+UN5f3VEGxFTiSjqdLty0 VDmPh5JYeTLyeqeQVtusCNB9XrBC3uZB1gKWdX+rog/S+pIHycp/eBFEQAlT2GWURkUy n1ZN4a985Aq3q3s+1xXo/q94KVgR0x74GrBE0hGeA8QTsGD/8yCk4ofniuNs7QAdHQyK zLiaF5OHOfx7DoQWhg9i604zo3n6Pu/ZfxLhqrA8/iJ/UCX4paY2evaI5cP+drgkN060 LD7x3QGlSDkHeKzwueaNHxBbtloZhX+QPy89wEA/vBK+M/ngBBTCByxMQMP3z2j8cbw2 /ZkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x33-v6si2189901plb.477.2018.02.23.11.54.41; Fri, 23 Feb 2018 11:54:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933768AbeBWSpS (ORCPT + 99 others); Fri, 23 Feb 2018 13:45:18 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933755AbeBWSpQ (ORCPT ); Fri, 23 Feb 2018 13:45:16 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B5B6122E; Fri, 23 Feb 2018 18:45:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Branislav Radocaj , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 069/145] net: ethernet: arc: fix error handling in emac_rockchip_probe Date: Fri, 23 Feb 2018 19:26:15 +0100 Message-Id: <20180223170733.558199456@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Branislav Radocaj [ Upstream commit e46772a6946a7d1f3fbbc1415871851d6651f1d4 ] If clk_set_rate() fails, we should disable clk before return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Branislav Radocaj Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/arc/emac_rockchip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/arc/emac_rockchip.c +++ b/drivers/net/ethernet/arc/emac_rockchip.c @@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct pl /* RMII TX/RX needs always a rate of 25MHz */ err = clk_set_rate(priv->macclk, 25000000); - if (err) + if (err) { dev_err(dev, "failed to change mac clock rate (%d)\n", err); + goto out_clk_disable_macclk; + } } err = arc_emac_probe(ndev, interface); @@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct pl } return 0; - +out_clk_disable_macclk: + clk_disable_unprepare(priv->macclk); out_regulator_disable: if (priv->regulator) regulator_disable(priv->regulator);