Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9118840pxu; Mon, 28 Dec 2020 07:06:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXca6HOUGh2IpSLCT9TfMRc2LaFSzgp1IUzLJvyxjowNcHOEObtzhFuXGvT1WjCHSxMHyb X-Received: by 2002:a17:906:1916:: with SMTP id a22mr41897002eje.536.1609167993737; Mon, 28 Dec 2020 07:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167993; cv=none; d=google.com; s=arc-20160816; b=Ie7jUw/doFkqco+IWFOFiKzkaAzR0kiPfHtkl/6IQo1u57sr8EhxoydUuh5GW4qAT8 C3NngjpLc8il+pCRHyPeDqrGhddmqi2GHA/Czxk/F5PgWUcAvbLeWqBqG16WXv/1VTOe +du08Jy53rEss9EBXbfaVv5VbIHb6G6o+FSStgoeZBpDvKUrQbVCGhpoLKjy8UXBbhyr G+jmpLW53yTDj12N15EiTryUWhVekEoDl0u8kC74ApvRnP2ErIDtFIf3GjgaZnDa6bPy 8ibN9qeorXTdck+Z63tqoMjExcSSEfY+ckqcBtr1qeJwvOO9EJo8W2hV7UzC9VlwBIzr 3JxQ== 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=t4ObC1809ozyA+NxX5W6vhkZoy0fQ6Xbffb+6JwU8f4=; b=ESBHFJ30GX/3xQcHP/Cv6NoKITN6vcVQmaoz1i9TA5O2BThFgR/w10gb5iVQbNC9ye 0MO8aAnq2Sow2nnYSL1XGMOhutV2/Xia1/+52Nf3xwejKs8J0+DWSIOynLlPBmwDm8EX JI6IfFc12gOziBK2zE+Nh7Bh4sRgPN41aieyDYWR7q6HSyNP4IM4BqRmrZslyNr4k7bh ZoBlUPMTZgCbRylz7sjInjnjRGWMxP7z5VCG+UXYuVDH36mYBukXsBFPXvsTJpApD5Fi uEY4g6QRu4BC9J5hbE1PgcQvFtfZAR0fbrnpmlDWH+b3AzQNxAGBlJyaYdvn5dvPkAtR k7cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V3zWYl7u; 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 de20si19782746edb.171.2020.12.28.07.06.10; Mon, 28 Dec 2020 07:06:33 -0800 (PST) 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=V3zWYl7u; 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 S2408150AbgL1PDH (ORCPT + 99 others); Mon, 28 Dec 2020 10:03:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:46920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439929AbgL1OMn (ORCPT ); Mon, 28 Dec 2020 09:12:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA9F8206D8; Mon, 28 Dec 2020 14:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164748; bh=VMKm0JXwNMdwRjR3s4cacDpShKhF+LKcGss1VscGCQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3zWYl7u8oC6SSkRUah97Dr9V58rudkslH2oDnxEle0ur8NWKxc64gtkCs3HI6PIH lkSasq4ukRPS1Z6Xk1xaJWrbB4BftXWxpvhk7I26d0LsASnbcgzIRGYwh5/qiZ3AMa 1hVU4nMZ/e6oV7nWjQOWN9WCbAe3W7A1tY4xqZw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.10 285/717] clocksource/drivers/orion: Add missing clk_disable_unprepare() on error path Date: Mon, 28 Dec 2020 13:44:43 +0100 Message-Id: <20201228125034.682228688@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Yang Yingliang [ Upstream commit c1e6cad00aa2f17845e7270e38ff3cc82c7b022a ] After calling clk_prepare_enable(), clk_disable_unprepare() need be called on error path. Fixes: fbe4b3566ddc ("clocksource/drivers/orion: Convert init function...") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20201111064706.3397156-1-yangyingliang@huawei.com Signed-off-by: Sasha Levin --- drivers/clocksource/timer-orion.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-orion.c b/drivers/clocksource/timer-orion.c index d01ff41818676..5101e834d78ff 100644 --- a/drivers/clocksource/timer-orion.c +++ b/drivers/clocksource/timer-orion.c @@ -143,7 +143,8 @@ static int __init orion_timer_init(struct device_node *np) irq = irq_of_parse_and_map(np, 1); if (irq <= 0) { pr_err("%pOFn: unable to parse timer1 irq\n", np); - return -EINVAL; + ret = -EINVAL; + goto out_unprep_clk; } rate = clk_get_rate(clk); @@ -160,7 +161,7 @@ static int __init orion_timer_init(struct device_node *np) clocksource_mmio_readl_down); if (ret) { pr_err("Failed to initialize mmio timer\n"); - return ret; + goto out_unprep_clk; } sched_clock_register(orion_read_sched_clock, 32, rate); @@ -170,7 +171,7 @@ static int __init orion_timer_init(struct device_node *np) "orion_event", NULL); if (ret) { pr_err("%pOFn: unable to setup irq\n", np); - return ret; + goto out_unprep_clk; } ticks_per_jiffy = (clk_get_rate(clk) + HZ/2) / HZ; @@ -183,5 +184,9 @@ static int __init orion_timer_init(struct device_node *np) orion_delay_timer_init(rate); return 0; + +out_unprep_clk: + clk_disable_unprepare(clk); + return ret; } TIMER_OF_DECLARE(orion_timer, "marvell,orion-timer", orion_timer_init); -- 2.27.0