Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A206C388F7 for ; Wed, 28 Oct 2020 09:10:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD29A2468F for ; Wed, 28 Oct 2020 09:10:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CGcWtDAm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD29A2468F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=4L1sxK56Mt25WReaTiy1kOIvaHdx1sQrtr3bbtooL18=; b=CGcWtDAm+Wo4TfSCZXzYir0faq ghrkWl+XikD1dF7kkmSPpJ3ZkwoYbMxIBfhGs2bHVEPd/1Pkp6B5nTzSYJfsni0x/D3Rpv17LKaPd j84gJBYQnoiIi5xoT1S0U+IUsvGJcJ40yWMe11apib7uR8IbGpY/DnNi8vHqAGSgdCF5T43Pxrejb Tw2o5rMqzvlfcRrLvewAwVYWjFPHcVg09WUde738zYO3d6w0JgZKhgTGywTAIJIhba0V0xlTp8xkt 6kRjPYCEMPLq6j3E7uEVR9TXwvfr0kIWXoFxx4Qv9aF4ZTgfab+dX9gQgazDxeBgchz272B+8F4Ku FnQMYZyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXhT4-0007Xs-Gt; Wed, 28 Oct 2020 09:10:06 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXhT1-0007VK-PP for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 09:10:04 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CLjT252lSzkZf5; Wed, 28 Oct 2020 17:09:58 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 28 Oct 2020 17:09:46 +0800 From: Qinglang Miao To: Lubomir Rintel , Russell King Subject: [PATCH] ARM: mmp: fix missing clk_disable_unprepare() on error in mmp_dt_init_timer Date: Wed, 28 Oct 2020 17:15:42 +0800 Message-ID: <20201028091542.136120-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_051004_146682_52BAB680 X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Qinglang Miao , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the missing clk_disable_unprepare() before return from mmp_dt_init_timer() in the error handling case. Signed-off-by: Qinglang Miao --- arch/arm/mach-mmp/time.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 41b2e8abc..212823800 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -209,12 +209,15 @@ static int __init mmp_dt_init_timer(struct device_node *np) } irq = irq_of_parse_and_map(np, 0); - if (!irq) + if (!irq) { + clk_disable_unprepare(clk); return -EINVAL; - + } mmp_timer_base = of_iomap(np, 0); - if (!mmp_timer_base) + if (!mmp_timer_base) { + clk_disable_unprepare(clk); return -ENOMEM; + } mmp_timer_init(irq, rate); return 0; -- 2.23.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel