Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3764024pxt; Tue, 10 Aug 2021 10:46:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySY2chLagw1Dp+kYs/3vYHxXltoyDIY4qP0TfJU8hBc8Z44Ie9cm9Otk3J3J0RZ2KrP8zx X-Received: by 2002:a17:906:2497:: with SMTP id e23mr28848793ejb.194.1628617572885; Tue, 10 Aug 2021 10:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617572; cv=none; d=google.com; s=arc-20160816; b=iaMXNQ1yIrv4w/n1mUbkZRylyX1S+eDd8vbExr4jHfmiiNJeTMjVYVmy1qdiq8TxJn qi0ot73pcOrbr9JIa4GJjHSSlys6Zn4byyERlybyaWx68RRm+6tWlZKDg0xgU1cPoPjG LndIdQp5c0NlQm+SmpT1q46dDNsOs4LLSUpjMh8AlU07cz4ip5UT5gLEYM4+ITNlmqc1 a7fiYaytIKKV7k9Bbjg2Zm90AqVIOg3kEVfpnqdrxK7xXOVGYtK2Ln8HRTVSpZAAOQHc RIvvvxkB+kW7tF5/NcWeMj6T02wtVxvaNRDpUQDqYqeFg7pjjyXU5HoaLH/PJ44wrH7I aoDA== 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=hNKgHZZFqmaxn4hBYMfBaEfQKBq8gYdBhqpJ9I0hwRs=; b=RqtbqItwYT91ndP3vNnpAbDrpOAHymtXZPcO0xJtAiE6RizRFRt/rXkt/GklXT/NGx 8rQbEJK0p0f8/jYf0UQuyDO4L08Oc2rULzZ7hPql5esS2x8aCw8J7nU11Swvo3gcnWK6 h3EJvJCbjXol/N4GWRueEhuY7RnmVMgdktAHIkVqL3UB4iYghBl/syPpXUjSoMEJTjn0 3RBh6LsLNlbSJWGxRQHYrh1xx4dKR+xquN+RLLb/Zkdu8dDqmlcNoiBa7W/nwXMIr/mT LRuE5D30xZyNBJBzOgSyMekVldVwppQ6F4j2u7D1WjB0OBsTC7dO/AeiXZHK12ll9p9W xBug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rlzLYkmY; 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 i2si23778250edf.568.2021.08.10.10.45.48; Tue, 10 Aug 2021 10:46:12 -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=@linuxfoundation.org header.s=korg header.b=rlzLYkmY; 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 S235896AbhHJRoK (ORCPT + 99 others); Tue, 10 Aug 2021 13:44:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:59866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbhHJRkN (ORCPT ); Tue, 10 Aug 2021 13:40:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06A8761184; Tue, 10 Aug 2021 17:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617083; bh=Fag6D66siujgCk6NxA1m/fyPbXy77UlF9MvHbsDywGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rlzLYkmYdIy1e+HaOEeR8vZD9yMcsjDnP6OCHgzfQguZ40UiY4MdOdgRKIi7afOgg Q25/Dql6bUES06n9Dpxe8klNvJxsDfAbgjEwjLs+wXjeuXE6kTZvuG4B/+D/x4Vnq3 s2YMMXkkpzzx3wBDO0WSnT3YqbnoJbEvezEgUUSk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Dong Aisheng , Shawn Guo , Sasha Levin Subject: [PATCH 5.10 007/135] ARM: imx: add missing clk_disable_unprepare() Date: Tue, 10 Aug 2021 19:29:01 +0200 Message-Id: <20210810172955.919300067@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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 f07ec85365807b3939f32d0094a6dd5ce065d1b9 ] clock source is prepared and enabled by clk_prepare_enable() in probe function, but no disable or unprepare in remove and error path. Fixes: 9454a0caff6a ("ARM: imx: add mmdc ipg clock operation for mmdc") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Dong Aisheng Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin --- arch/arm/mach-imx/mmdc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 8e57691aafe2..4a6f1359e1e9 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -103,6 +103,7 @@ struct mmdc_pmu { struct perf_event *mmdc_events[MMDC_NUM_COUNTERS]; struct hlist_node node; struct fsl_mmdc_devtype_data *devtype_data; + struct clk *mmdc_ipg_clk; }; /* @@ -463,11 +464,13 @@ static int imx_mmdc_remove(struct platform_device *pdev) cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); perf_pmu_unregister(&pmu_mmdc->pmu); iounmap(pmu_mmdc->mmdc_base); + clk_disable_unprepare(pmu_mmdc->mmdc_ipg_clk); kfree(pmu_mmdc); return 0; } -static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base) +static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base, + struct clk *mmdc_ipg_clk) { struct mmdc_pmu *pmu_mmdc; char *name; @@ -495,6 +498,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b } mmdc_num = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev); + pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk; if (mmdc_num == 0) name = "mmdc"; else @@ -568,9 +572,11 @@ static int imx_mmdc_probe(struct platform_device *pdev) val &= ~(1 << BP_MMDC_MAPSR_PSD); writel_relaxed(val, reg); - err = imx_mmdc_perf_init(pdev, mmdc_base); - if (err) + err = imx_mmdc_perf_init(pdev, mmdc_base, mmdc_ipg_clk); + if (err) { iounmap(mmdc_base); + clk_disable_unprepare(mmdc_ipg_clk); + } return err; } -- 2.30.2