Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5883311rwe; Tue, 18 Apr 2023 13:05:58 -0700 (PDT) X-Google-Smtp-Source: AKy350aDNephGSnmcP9EvSA8s/Ip20z4tGc7oC9GPmT+fw3gXgi8lDZQDXn8XWsACJ1ErJ2Cq36o X-Received: by 2002:a17:90b:198:b0:249:64c6:3d78 with SMTP id t24-20020a17090b019800b0024964c63d78mr763627pjs.19.1681848358009; Tue, 18 Apr 2023 13:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681848357; cv=none; d=google.com; s=arc-20160816; b=mmnPikBDkt/PJiWAuYIYqtKP4zxUgyr53M02SKE+T3eh4/dlmBWc03Hqu6160Rd2Wn YP2573c1c/+TtLLgHgFnUJc8sSsFvKLowFSTrSg/bPWyUuvxtM5cNhLeBnZYt/MnbYWt gDg4bqvygHdRf3GQ4N8umUmhHVZnYID0B5Y89n1JyCA405u8+isHjBJKM5t26I5gDiFI 3xLfO36g9SCeCr4lYQvpr/Mf/Tx27GesviIHslBka19YYAiLV2DHrkxzqOvowPLhCHm4 qszfWa++HL1W+AVsrMDAmHDX0RNU6ITdzPlS0i8dF2ACRSHWoC8E9A/BnoACRdN1onTa 38Uw== 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=NUM/9EfT+oCdQ/ixSz3HeS2pAje1HdCv95koR/4MgXw=; b=nYijB7A/rGKhp+FUHeeMdffZKR5/TzkXqlaQD3brsr0sVagsd8zk+eN5JFI1CrJmI6 9NvP3ZBZLISbdqL1G58N+LLohtdoswdjw9wjtn34CXbsas9iPPaHbrysQZXKcoVU5R9x D1CWRKjgJtNSEyoqI0LyV7lkfkI5+GNqB43mAg3SOvOdBqnbA06jy+ZnAwhVbDMxN1xl D4YVbfeJlr1pNoD/CUxEhymn+G/QcQ6F1752AS1iW6XwZqFjLu/ARkPypiZJSy2fhMrM mhmBTrf+ZfDvOPfd04N94fgIrr3CNcYqn8TVbVlAlq35k/w+hxJvxtvPk67uw+GcP7QK j76w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JXUejncS; 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 j3-20020a170903028300b001a4ee96c00bsi15979009plr.357.2023.04.18.13.05.17; Tue, 18 Apr 2023 13:05:57 -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=JXUejncS; 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 S231352AbjDRT5L (ORCPT + 99 others); Tue, 18 Apr 2023 15:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjDRT5K (ORCPT ); Tue, 18 Apr 2023 15:57:10 -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 E85DDB745; Tue, 18 Apr 2023 12:57:06 -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 1D413638A8; Tue, 18 Apr 2023 19:57:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78C26C433EF; Tue, 18 Apr 2023 19:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681847825; bh=NUM/9EfT+oCdQ/ixSz3HeS2pAje1HdCv95koR/4MgXw=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=JXUejncSyNOOCDo8jBZ27fDUD/UKurH9wZTS0gV6Esh2yl9h727mpeTEyIbN6lb9o h24hf90F7jv7CQmfcFVhW+ArrA3OrbDx/Xgfcej1OwEA8yvjJaIlS5JVlCMlkQzyup PooDhkPIfFfASUGlRHWF+JrvvOZ0h2BtFwsvpjz088Ddq5YyvoZRXCSh9J7xiZdouG 8195udD1neDJxPlOrpSh8ql/TijCVTYqHHOiMF70BqgMg3AHIU8dlePTzCaK6XS+LF LILwrO52URPOeZRNix4JL0td0cn+qCXVLg2URtN2EPqPJSw7EDwOBQnnmcVYg7cNg0 sx8dbLU29Dvmg== Message-ID: <86398a778336846688c33a737e2a9ae2.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <5e18370b.3c8a8.1877d7fc98a.Coremail.u201911681@hust.edu.cn> References: <20230413032439.1706448-1-u201911681@hust.edu.cn> <25b06794ffb595229019640e10f256fd.sboyd@kernel.org> <5e18370b.3c8a8.1877d7fc98a.Coremail.u201911681@hust.edu.cn> Subject: Re: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe' From: Stephen Boyd Cc: abel vesa , bai ping , fabio estevam , michael turquette , nxp linux team , peng fan , pengutronix kernel team , sascha hauer , shawn guo , hust-os-kernel-patches@googlegroups.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hao luo To: =?utf-8?b?5ZGo5biI5b63?= Date: Tue, 18 Apr 2023 12:57:03 -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 =E5=91=A8=E5=B8=88=E5=BE=B7 (2023-04-13 19:02:19) >=20 >=20 >=20 > > -----=E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: "Stephen Boyd" > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023-04-14 03:06:59 (=E6=98=9F=E6= =9C=9F=E4=BA=94) > > =E6=94=B6=E4=BB=B6=E4=BA=BA: "Abel Vesa" , "Bai Pi= ng" , "Fabio Estevam" , "Michael Turq= uette" , "NXP Linux Team" , "Pe= ng Fan" , "Pengutronix Kernel Team" , "Sascha Hauer" , "Shawn Guo" , "Zhou Shide" > > =E6=8A=84=E9=80=81: hust-os-kernel-patches@googlegroups.com, "Zhou Shid= e" , linux-clk@vger.kernel.org, linux-arm-kernel@li= sts.infradead.org, linux-kernel@vger.kernel.org, "Hao Luo" > > =E4=B8=BB=E9=A2=98: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak i= ssue in 'imx8mm_clocks_probe' > >=20 > > Quoting Zhou Shide (2023-04-12 20:24:39) > > > The function imx8mm_clocks_probe() has two main issues: > > > - The of_iomap() function may cause a memory leak. > > > - Memory allocated for 'clk_hw_data' may not be freed properly > > > in some paths. > > >=20 > > > To fix these issues, this commit replaces the use of of_iomap() > > > with devm_of_iomap() and replaces kzalloc() with devm_kzalloc(). > > > This ensures that all memory is properly managed and automatically > > > freed when the device is removed. > > >=20 > > > In addition, when devm_of_iomap() allocates memory with an error, > > > it will first jump to label "unregister_hws" and > > > then return PTR_ ERR(base). > > >=20 > > > Fixes: 9c71f9ea35d7 ("clk: imx: imx8mm: Switch to clk_hw based API") > > > Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm") > > > Signed-off-by: Zhou Shide > > > --- > > > The issue is discovered by static analysis, and the patch is not test= ed yet. > >=20 > > And you're not coordinating with each other? > What do you mean by "coordinating with each other"? >=20 I see two patches to the same driver from the same university on the list. Preferably you coordinate and decide who will fix what smatch warnings.