Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3764889pxt; Tue, 10 Aug 2021 10:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYpGTs/o6DbaFPLMA4DCsmb8i2QTlEjsOZw1Vj4RfZvEqkTQufVaCTk+aM92pLdzsgkQ/+ X-Received: by 2002:a17:906:4c89:: with SMTP id q9mr28481426eju.118.1628617639544; Tue, 10 Aug 2021 10:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617639; cv=none; d=google.com; s=arc-20160816; b=gC/zx+JKo0TlG9urBkc32ij4VZMNP3H04P/kcUqPT6l6hLCZwOaqJ+j0ZestW9jPbE GNYVYwYg7g90e65mMcK1pSfISnxW1qUWQplNXwsSTYdaFYNtGiGN6Pc7Kf9BgHwmz4ce MmTpp14E4xBhHY6zFYowshJcdEctNIxfMv/Eb6bg2iIw0V4lFThQPYd1h2ASluKw3u68 hMOBfBGDom+1MtpkZagZng5eI/G7DMyiXGP5vWDEkMFqAdusQW27F9rj40OrFeVl4DTQ 7AwMQTwST6rFpmgaqkORv6BrKWEhq94QQKRD5OXaNGW0pT75mCDQ8Zn6Hgv9AnOqj82l RxNw== 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=jIFcgsOqRX0uXxOjIeKEw6FYCMDUkcGPEyd6IAw0LIo=; b=0uwC776pOpLTMggfvxddSMb4N7p8Q0422h1G45H5DW8oVf7PTTa9SkPr+7/lELU9k7 dEgLEIJDvm/Rn+dGEkL6u4bTX7V7EMRKdpbfhnn/EnR+c85BD/3mBdhfUV242Ft+F5+r uyDaIdh8rB6jvvafl2YcfQvxu2bBm3if/O6RnaZDFZztZ1mfh1lnKyiYQ7LfSxQFBe3N r9tW29X+UYkX1Yvfx5z805vuklKMRXk/w0qa4MeBGVW3aZRbVIktxjaDLMlhicR1AriB DVwDb4oqjZzd0vfs9o+rlKJAOxMsIiKOTkZedbf8sd6lqKCogaUg7aBz1266oaOka0LM 3JoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=INNhdtc0; 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 c4si7359282ejs.299.2021.08.10.10.46.55; Tue, 10 Aug 2021 10:47:19 -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=INNhdtc0; 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 S234940AbhHJRoG (ORCPT + 99 others); Tue, 10 Aug 2021 13:44:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:44922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232755AbhHJRkJ (ORCPT ); Tue, 10 Aug 2021 13:40:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B840660F41; Tue, 10 Aug 2021 17:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617081; bh=/qj3ROmv9sS7iWFoTfgK8dGOGy/KKWHecO55OPEVgds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INNhdtc01Udy7IUz+Yl0G+pOGg7VMjOB1IuRNWtz29HsF6sYCiOp4kb30FmU94KwE WMhTvpoAIur6jLdW2FQf5P9WUw1jPriu3/QNp1cUMDn/CLmhLJKH6/NGeoUYPXcn37 2QYil1J0yf/fgxN+qhQaAmDUYRSMpWSz7TOe70fQ= 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 006/135] ARM: imx: add missing iounmap() Date: Tue, 10 Aug 2021 19:29:00 +0200 Message-Id: <20210810172955.889629130@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 f9613aa07f16d6042e74208d1b40a6104d72964a ] Commit e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") introduced imx_mmdc_remove(), the mmdc_base need be unmapped in it if config PERF_EVENTS is enabled. If imx_mmdc_perf_init() fails, the mmdc_base also need be unmapped. Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 0dfd0ae7a63d..8e57691aafe2 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -462,6 +462,7 @@ 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); kfree(pmu_mmdc); return 0; } @@ -567,7 +568,11 @@ static int imx_mmdc_probe(struct platform_device *pdev) val &= ~(1 << BP_MMDC_MAPSR_PSD); writel_relaxed(val, reg); - return imx_mmdc_perf_init(pdev, mmdc_base); + err = imx_mmdc_perf_init(pdev, mmdc_base); + if (err) + iounmap(mmdc_base); + + return err; } int imx_mmdc_get_ddr_type(void) -- 2.30.2