Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp55362pxx; Wed, 28 Oct 2020 18:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb+OrDjSOFtyMsEWm2vwkng8eqER+Su9pYgy2cQoRWu0Hr1HOLYVjZauKCK7nSq97x34SJ X-Received: by 2002:aa7:d496:: with SMTP id b22mr1657519edr.123.1603933241903; Wed, 28 Oct 2020 18:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603933241; cv=none; d=google.com; s=arc-20160816; b=HXMRNT49UyBY8/ihpC4d0STFVcThvKdtmMCBqEAFK1UG7rM9Zj/9aefhRLt7w70ERL PxFTCxeBf+FdpQODmVW6UGbqRuZMi9hIWwhRQ2/bAH2RUkkL7dJB4Yz2cigiY7p6sMHX pfn4M8HXgJ7GoMh+EEAgdeODqR8u7JbOWmjxjjBzVd+NK4gQKdDOIC13vGyDyE9hp50W RHFhDcD1urq1GtARt1/Xgcf1ejDylCcwY+Zqvibmgr1+i9R2Zrw2UQ8IVdtl0TaPVF0d iMbsVrpdCKmjcHNgsbjgALYpaBqdnAcPwVQbBaTPADYLw/YqcSHaEIW9umCoSOsMYlh2 MvGg== 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 :message-id:date:subject:cc:to:from; bh=Oxeda0LQA1NUSMyNMpuqf89t3sSojjapg0nJcocFpCQ=; b=R89Pj5cfJRiVOvitnmjSVoIHxsk5mBtsEJIu/uTL4yBdy6UUUEB8j77URqFQrN4FrY hwEhZq9TGowKqxoZWY4qn9qE396q4m6t/H+gQaHa5TDelGaohBrGCrWPNFP5F5TXQWC4 5jVyzy4sM9tGVGsmZnogW/aGBgkWXw2p09IoIyEylmCNTl4bwGe9Mb11SzmB4WRu+dw4 ECFZdcHXtybM7HmQhd+A6LXHkJtj4+IblgpLrWJj8u0vhGiLr1u7M+lQX6fMulUR9NN0 24ZqzLpYNYSj+g6KIjqB4++FaZYtEuV+/P38k1ozWd/A4wm480oBXf22HM5eggMHMMjR j72A== ARC-Authentication-Results: i=1; mx.google.com; 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 r10si717190eji.253.2020.10.28.18.00.19; Wed, 28 Oct 2020 18:00:41 -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; 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 S1730375AbgJ1WJm (ORCPT + 99 others); Wed, 28 Oct 2020 18:09:42 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6702 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730241AbgJ1WI6 (ORCPT ); Wed, 28 Oct 2020 18:08:58 -0400 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 CC: , , Qinglang Miao 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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