Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3759309pxt; Tue, 10 Aug 2021 10:39:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyobNQRobL8FXiiD8ms7ezTBm7CMbX6h8REVO51z2M3js8yGelsjffzA3DOoq7GyNy0vABr X-Received: by 2002:a17:906:53d3:: with SMTP id p19mr4188840ejo.509.1628617161672; Tue, 10 Aug 2021 10:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617161; cv=none; d=google.com; s=arc-20160816; b=H7NkgAeU4wKw52sbJp39TYQQh9HFha9u9veL22RYdGY4eOPV3U/sjpsfvVv4eow3SQ LZ5suuCgIujc01PKAHFIQ3r35JnL6dUWC3DzRuPERH0I/HPCOaqAE8d5nPDvL7/kd1JD DKAuW9niwQtYMiR7+nfpEbPGsTB+LfH3xEklBrRqssTZk/tAdkhSfX0JjUslSmyEc8Er tg9eY80oz8m3FqGpzP9p2mjylDeIS3c7xamT2HIfZVyaexgYkRAk4M3UGeo/Dl+b83/s uP/G4EQveSLwZDH/0DmH1GIKHeW8DsgXxe9+9hPkG+6gCQcseuRN/4o65S8PQsnhBDMz v/Bw== 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=zJgcCX6U6LzJdx3zvjolYgGJvotfFNPXMrAOOD7YpZlk2TBEZjeKqh+Zr51kRRm8k4 r1b+dkRLhyWXlRhdxn8hWWvKOC2BFX94+qxbCXFBjH6XV/ACLEGSrM6SxwtGw3bDm4JG dQsOY/Tk149eS1q0slgDDa79NJkFqisbCK1Jqm49riPIgydLrbLhrU9kiFi/Bh3qms74 KMX6To+oCR2+D4MJN4fsFR63+YHKrV/OuZeAhMX3pk17bIt5ip13qpLMRaAIWX9+z2fX JVRtQBG/8iUo/NH+nqWGSoK2EIMSLN61Qz4aQiG58cP1x1FVYwfUXnVUtYRaudn8MoT2 Szfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n57EHChv; 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 i22si3039455ejw.286.2021.08.10.10.38.57; Tue, 10 Aug 2021 10:39:21 -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=n57EHChv; 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 S232956AbhHJRfT (ORCPT + 99 others); Tue, 10 Aug 2021 13:35:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232720AbhHJReX (ORCPT ); Tue, 10 Aug 2021 13:34:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B57B60EBD; Tue, 10 Aug 2021 17:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616841; bh=Fag6D66siujgCk6NxA1m/fyPbXy77UlF9MvHbsDywGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n57EHChv0USALGli1+37m03dzHSwNMslQ+9L1oxPPpnzceJBe4vy5vp2G2YpfCHZQ /ZH5KtY3sN9jzY5sGE6icteuv4wBBjn8/i75EWYjligvgDL0uJupXgsNUZiYZsjcgM B8RQw6zg78GHX7dDK7n+/DXGg5/FXdPl4KKGImTQ= 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.4 05/85] ARM: imx: add missing clk_disable_unprepare() Date: Tue, 10 Aug 2021 19:29:38 +0200 Message-Id: <20210810172948.384156029@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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