Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp557312rwd; Mon, 12 Jun 2023 18:45:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Ll0C4Pd+rA6uEguka3oVXjX0Ch1X13HxwESodylHfn04gFg3ss3rEwp/DESdtlwUZ2jlW X-Received: by 2002:a17:906:974f:b0:96a:411a:1cc4 with SMTP id o15-20020a170906974f00b0096a411a1cc4mr10949092ejy.66.1686620703260; Mon, 12 Jun 2023 18:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686620703; cv=none; d=google.com; s=arc-20160816; b=KkxxxlJ4yqCLlf4D6tFNGDDpPX70cYfsSj+xWo5+Fi+4otwqXUIpoeDR6S4+kVa8uH l+dxx7+HnSrdDizohMcSGOs063lWNwwKydzZUnQKhsyrUPSev13l6ASXiNpZIKnV86r0 QNeNvtkTFSk6AVyTKuZ0c3PWX2nqTn7D1nFYjaqUKo28CM/o7MZ1WYBR9NnYgyiqqlxm SF1jeXx+1yM+vxc1IkjLubINvHccZaMBp9k/L//VUC2veM+bnaJJ9u+1mjNPJ4zHEqxs Extbfa0IRmagT+KKMAVfZUPeBoOnqu1dNgOM80HR26d8oxpFC4D5H2yaTzaURBXBkcSa 9oBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=v0EBlr/PM4QpasyNcFjQSWhyDFAwRhR670557j1KNKw=; b=Bnsg5Pvs7i5rd73UrNgNHvMvRi+RjHIeLTtvAv1OCNzamQLHY1hIs9EhisM+vh71+i Gx8WnwnylK0GBGBoWzFvqhr63QHaGz93djHFOKn43q7bt0V0AmbDUPTryFYqv+CWnovc SnnMmDBPJjLkZ/RoNH5uthCP8sl7cwR03JRWn/MlROvYE27c0BqYDtF188Ag+boIAd6R cUjJC8mVm/4leYcYTwDdI6MuMTbGCzsPP19bHiXjR7jIw8zqAMM+hM0weq9EGzLW56HJ hpFhP+DGmy1uE6WySXsTyit6cZeut/BhsS74wa6PWKTnZi48IBQPd+bInwDI607oC39o ZjOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NU35VNuL; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020aa7c48c000000b0050bc36f514csi6221674edq.651.2023.06.12.18.44.38; Mon, 12 Jun 2023 18:45:03 -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=@kernel.org header.s=k20201202 header.b=NU35VNuL; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238008AbjFMB2Y (ORCPT + 99 others); Mon, 12 Jun 2023 21:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232685AbjFMB2W (ORCPT ); Mon, 12 Jun 2023 21:28:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF46B1711; Mon, 12 Jun 2023 18:28:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55A16617D1; Tue, 13 Jun 2023 01:28:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3D5AC433EF; Tue, 13 Jun 2023 01:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686619700; bh=aoQHeYjAPGfNsJxskI4bGk1bJt70oxm3UkCtG4nr2WE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=NU35VNuLeysvpUmDK0NJYN9LrNtUg81XsEOvJh4/d0EWZ/jnCtS10NUzZtkSDKGDx ca/gTk9Qm1HWacaDB37/fSwmWv5sMY7ThphibW0xlvESn+N/1J1vn6CTg11UTx2LX2 1doTKtxwMqDRIjTgvEXrsFJpTpLCR5F3HVlYJM7kVm4QEsQEL8Va5zNsdY3l9WzFA5 vaKRLifMIaVBaWA19QQOPGsIXmzfYMv/HdUInE4Dwnp7vIhrl0+nIKaoKAyqCkh+D9 PvsWslQ06rT3mZ1flvjwE94ncnwQCkeVSjnedNgFOZD2Dbo8I3Qrk3uNiJRWjJ760V NpX9zizYlLlrA== Message-ID: <47f1be5577fdf4a2ab36d1f6dc0c393e.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230422084331.47198-1-u201911157@hust.edu.cn> References: <20230422084331.47198-1-u201911157@hust.edu.cn> Subject: Re: [PATCH] clk: mediatek: fix of_iomap memory leak From: Stephen Boyd Cc: hust-os-kernel-patches@googlegroups.com, Bosi Zhang , Dongliang Mu , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org To: AngeloGioacchino Del Regno , Bosi Zhang , Chun-Jie Chen , Ikjoon Jang , Matthias Brugger , Michael Turquette , Weiyi Lu Date: Mon, 12 Jun 2023 18:28:18 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Bosi Zhang (2023-04-22 01:43:31) > Smatch reports: > drivers/clk/mediatek/clk-mtk.c:583 mtk_clk_simple_probe() warn: > 'base' from of_iomap() not released on lines: 496. >=20 > This problem was also found in linux-next. In mtk_clk_simple_probe(), > base is not released when handling errors > if clk_data is not existed, which may cause a leak. > So free_base should be added here to release base. >=20 > Fixes: c58cd0e40ffa ("clk: mediatek: Add mtk_clk_simple_probe() to simpli= fy clock providers") > Signed-off-by: Bosi Zhang > Reviewed-by: Dongliang Mu > --- Applied to clk-next