Message ID | 20230615122051.546985-4-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp610625vqr; Thu, 15 Jun 2023 05:54:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ovp5Q0jZFJuDvoraq1toPpVPkCg2rJ54PoebWX9SzFkmceZ4nCYBjj5fhK3CVOaQC/Ykr X-Received: by 2002:a2e:b0c3:0:b0:2b1:b9b9:20d4 with SMTP id g3-20020a2eb0c3000000b002b1b9b920d4mr7956866ljl.5.1686833667344; Thu, 15 Jun 2023 05:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686833667; cv=none; d=google.com; s=arc-20160816; b=KIGgaem0rMAXf3Jvw4W/4bMucTddVNhxkT9YoryEOcUNd4qnSnz1i5yHqEymiV69LX MBn3cl1QwA/eYlYFYmYFxl/yz7IvPM9cTlXUdF4+6Bh0Ew26FYjvS8H1W5NbNX1w4LZS pPNIPiWqKr3Te2bW2n1XpTzR9XmeQ9VBTLd6gr+oNY4z95+6Q97FBTzGWFKnJLB0Zfi2 7XSCZ58TWV0F906Jn/yNdx5ndCOdlHTeTHWExroUO9Gdy9qPI2mT9yP66YGeMu6wSp3J sU11g4PvD87F1MQJ8i+jNqIH37nzNOeJerliUhfosCRbrVgal0oj6JKjdHMFJFbRY/DQ 5TZQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CPOV/siwNYabRVqnQGFNnDT0X3Og+j/1JoZMfa2hxqQ=; b=KcVFFnMvsVcYxuxJPncbh2BPTVukpefhf2VABP8JdgPeZ/utn2olMNsGLq32P6hI5n Ou+yB80fNl41YT20YcUc5auNPvIkOeQyOrQKImPsTs1ijNjcxDWiIfCWdT7cRZ9hj6TN xraQz2m2MPc4R9mOUT/LrI4B/uJxTaW1hZ1upDbwtsMg2NLWVfgYbkKDWBzGCkFZAulz +AOW6zNRb0Pyou6mm3XWUhKM1AjOJFqLO7D0iKRnrqk99LxGMOHNrRay+gY4e+nKHyUV vRoNznr15754V1vS0DZ8WHF6FSCsvM+Myhlmu0s9k3onY79LkQIrqGlNXrfZBUz6Ooj+ Wf7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YMuyc0yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020aa7cb92000000b0051a1e3d787csi1398120edt.198.2023.06.15.05.54.03; Thu, 15 Jun 2023 05:54:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YMuyc0yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344829AbjFOMW5 (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Thu, 15 Jun 2023 08:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344404AbjFOMWI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 15 Jun 2023 08:22:08 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFD36297C; Thu, 15 Jun 2023 05:21:10 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 66FB36606F6E; Thu, 15 Jun 2023 13:21:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686831669; bh=vpOgvT6yygDmgfAiQqASqbcSsnVHPhA2AtXGuQCWxfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMuyc0yb8fxIW6zoWi+1oHJMnciKLwwSzP+XQXbUMZ85AwWoloC8MY5PiQLE2GWtn xS9zWDy4wuxIIGsgz8aMVjziOj/2nyHoe3TscpJrakY0t+o74owZNgw/OnwsojCb+y XoYI+6tCzyTaSCiIR/zcegZMGNBt3ohBvgXet5qRPFGjF96Glh4MEPPdAOdq0ulUyA urK5G5Mo3BEoZEC3myqd96yH0J3NYVAOZu7tvUO7bDh+a+g2Vz9u76t0pgWzBgbKPq nMq0qC1n3OioHZY4qaFlIKmuHZ28t/4+2FOsXAQs3DPiWMLHjf7XnUXXgoEQQmlqpl /iWSFZNhRdN4A== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: sboyd@kernel.org Cc: mturquette@baylibre.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, u.kleine-koenig@pengutronix.de, msp@baylibre.com, miles.chen@mediatek.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: [PATCH 3/3] clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue Date: Thu, 15 Jun 2023 14:20:51 +0200 Message-Id: <20230615122051.546985-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230615122051.546985-1-angelogioacchino.delregno@collabora.com> References: <20230615122051.546985-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768773299289794023?= X-GMAIL-MSGID: =?utf-8?q?1768773299289794023?= |
Series |
MediaTek clocks: various fixes
|
|
Commit Message
AngeloGioacchino Del Regno
June 15, 2023, 12:20 p.m. UTC
In case of error after of_ioremap() the resource must be released:
call iounmap() where appropriate to fix that.
Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On Thu, Jun 15, 2023 at 8:21 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > In case of error after of_ioremap() the resource must be released: > call iounmap() where appropriate to fix that. > > Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Hi Angelo, On Thu, Jun 15, 2023 at 02:20:51PM +0200, AngeloGioacchino Del Regno wrote: > In case of error after of_ioremap() the resource must be released: > call iounmap() where appropriate to fix that. > > Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c > index ba1386e70a24..1bbb21ab1786 100644 > --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c > +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c > @@ -151,8 +151,10 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev) > return -ENOMEM; > > clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); > - if (IS_ERR_OR_NULL(clk_data)) > + if (IS_ERR_OR_NULL(clk_data)) { > + iounmap(base); > return -ENOMEM; More of a nitpick, but I would prefer if you would use the same error catching style as the rest of the probe function: if (IS_ERR_OR_NULL(clk_data)) { r = -ENOMEM; goto unmap_io; } ... unmap_io: iounmap(base) return r; Best, Markus
Quoting AngeloGioacchino Del Regno (2023-06-15 05:20:51) > In case of error after of_ioremap() the resource must be released: > call iounmap() where appropriate to fix that. > > Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- Applied to clk-next
diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c index ba1386e70a24..1bbb21ab1786 100644 --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c @@ -151,8 +151,10 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev) return -ENOMEM; clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); - if (IS_ERR_OR_NULL(clk_data)) + if (IS_ERR_OR_NULL(clk_data)) { + iounmap(base); return -ENOMEM; + } fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs)); r = mtk_clk_register_pllfhs(node, plls, ARRAY_SIZE(plls), @@ -186,6 +188,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev) ARRAY_SIZE(pllfhs), clk_data); free_clk_data: mtk_free_clk_data(clk_data); + iounmap(base); return r; }