From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 483EFC7EE2E for ; Tue, 13 Jun 2023 01:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232921AbjFMB2X (ORCPT ); Mon, 12 Jun 2023 21:28:23 -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 Precedence: bulk List-ID: X-Mailing-List: linux-clk@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACCF5C7EE2E for ; Tue, 13 Jun 2023 01:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EzT9kjivTi6uYhFgCi1o7C45l/M2vMFRUw7PSo4OoQI=; b=PGS9KmD3TSp32X LBoa5kd5rLRKtQa4KYmIWj/ls4tq5EvWAnfTWDDozSSHYwWPjuDkQavGXpV8bWNzv++H5s1QJshHN f1fhlvugojXnxCFiz6ATO6atGOtZGJfFM3tPMxa1nXwQ88D6/q/IkOWQo26fhme5q7RXtgjzUjab4 xwjYi47I96BZysW0wR/yx8GGAfwtHklRWXuyYWxjo7puGHX2ccO2llMOCLAHwvJZxQ3pX82BCuamf QsuJFidrF0osJKleUUBmopr0zIE+54+00icxpyTNxjl6RGZzAVD6ATUCxNfYW4Ia5IBuQPohhuVlO pBFnLvlwYxTY6xZK6lvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8spc-006ZnA-1e; Tue, 13 Jun 2023 01:28:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q8spZ-006ZmZ-2Y; Tue, 13 Jun 2023 01:28:22 +0000 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 49572618A8; 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> MIME-Version: 1.0 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230612_182821_891178_A5FF14EA X-CRM114-Status: GOOD ( 10.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. > > 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. > > Fixes: c58cd0e40ffa ("clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers") > Signed-off-by: Bosi Zhang > Reviewed-by: Dongliang Mu > --- Applied to clk-next _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel