Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3760035pxt; Tue, 10 Aug 2021 10:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUjLyP/bo92Z0asHg+FDn1hW2iUyj5BBJ5JwJAp+LDoXxuY323MIyw4KwI52vwNdPTjLkc X-Received: by 2002:a17:906:c013:: with SMTP id e19mr29286159ejz.389.1628617228138; Tue, 10 Aug 2021 10:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617228; cv=none; d=google.com; s=arc-20160816; b=OTz6iWYqwwUWfiZOEKbple3Wb6MjJhdas7TpY20klRzSLstzKl3zkoxat/+DMy6OWV 9pg0R11eLYDRqKm4zC4A0w3iaMbwfW1n80lNKNeCEANJoNssTQJiHYYtH0vCAFlA4ZIl AvakArgdaGxpvvtP/fanS7C9e+IAlTYGjX4kdGLDK3fbyxYT2fCvKMVIMiJV0hz/wLjB q4e6Oih40rJaCQ+LK22uPv5Wh/JrrTW2qA7LoKGYSLhP/skqaMcw71q4s05Fbxj3JC7P xW+NoxUWl1Jw/7v2qRrMGTHEdE0brlqRRAUw4i0NSDCVU48kh0QgMmyDN5Kcxnl8tZo/ qXDA== 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=Xxf2/Y+wq7cUKT0EXxzc1sw+UUttVVEGRCeUuevecgFmwe4/4MlyTf1X4hhyOyFdpd GqJj/UL17j2Ua4sR7mjS0KekYv9pJkon4XTxWq+dYGEYJ4dty2ZwrAj8MzgnqbiuxyON PzL21IarHxUKLvY4rT+UQ99lPd3wjfHcPiwDVQ3gV8Mj6p6uOEGBdoGdCV4HqoZHMqYa +7iM60o0T0tyfzd80uUkzHfM/HHCj2x/lcRMhx7XiAuSQlTCaPLI7Q7QCEd3L0+czgd4 TeuCEc9hN2cwcIhsg4gTSLSpJkBuV9k2WuQxPML5wa64+VVKw9d9mZ3duJ956rMIfvi3 TUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UtIibfRz; 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 d7si1175851edm.267.2021.08.10.10.40.03; Tue, 10 Aug 2021 10:40:28 -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=UtIibfRz; 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 S233361AbhHJRfM (ORCPT + 99 others); Tue, 10 Aug 2021 13:35:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhHJReV (ORCPT ); Tue, 10 Aug 2021 13:34:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8F4061019; Tue, 10 Aug 2021 17:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616839; bh=/qj3ROmv9sS7iWFoTfgK8dGOGy/KKWHecO55OPEVgds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UtIibfRzLb5NFofvAHUq1bY39gPhEKwxltQDRNCo5RF/Xdk3xOBz0gMuECVATSSFi c0fHFds07d6JxLMWYLOhtEY9XFr32X+Z+ddvhoFfIW4wVamqLGfAgQxugrcwr4odW5 yKMD85JAK6dIVUr3ISHaVY2G75UiDASFXFMd2YCE= 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 04/85] ARM: imx: add missing iounmap() Date: Tue, 10 Aug 2021 19:29:37 +0200 Message-Id: <20210810172948.350236728@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 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