Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp71044rdb; Tue, 31 Oct 2023 00:26:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGo3r+RzTbXmEzhNctw8lpoHd4VGJvfic4Tq/nXvVqTdh4ElK2INsjMS+KrhSZfQq6FVGx1 X-Received: by 2002:a05:6871:652:b0:1e9:b4d1:9bed with SMTP id x18-20020a056871065200b001e9b4d19bedmr12720568oan.40.1698737165640; Tue, 31 Oct 2023 00:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698737165; cv=none; d=google.com; s=arc-20160816; b=yOxApT8cMumqMc5CktKnSAxYYcE3fBEeRPxF0M/7U+KRvSAGyNfd3y9zDgDzN+LqWg 7HdUAfnW4ayrKB2WMrUWb5jMU4sFwmPVL/ir3JqtgpsEq+Jul/z52dqN1isXfJ/txpFU 8RLfmV7E2hU0E/9NJc5m6aHoRYHzWmjvvJB7ym8lWZHsnc8c+9Zd2KDpMU3yfOpYvOcc MWXsHHcx+0SwIQUjca0Y+oUH8uBTFYoE+Hu4P4QXhHjAoJjFppipHKCBkGY5Ta80JK15 ZUCuSIKARhXUMRwz9ZDyG+ZN0WWXN2Jhd0d1DNdcoph3pUrEHN3dm326fVUzSclabFwj eQfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Yjxq8E7gNPB9bFCXU5zCmu0wTmIMA9QI7im5HIAGob8=; fh=uwPiy3BvuwE4Dg3K+Km0RLgK6A//vWUiU0gWucUqKpE=; b=I2R/yRAdvc728/oRQjIW+E0Esph/H0D3GB87a2wxFMpn+mFwgljmu/mTvF2rj+rNfp 7xevST9Olk5zIQOwyNcqG1a0mjUOB9vGdyTsBj2dP7RSYKsriYlzQtNH55xW0ZGO+Gyq vtSPCjsAKupALDHpzBziVS/Eh0HmSew+c5d2AB3iFWtFCuwBkmkLwJ1lKHESWWMHEcew KFgDUcAiQha13vqS/9ySEG5fyT21pT9/ad5rBONkn53a4L4fUmPNRKB/hLgPDvCS6IAH j1LAjcQSgKHzcgYU2d2a546gdQwjVmBepP8rBnq+fmveWAa5/rMHDfEjytBi/cAmbwcQ 7mlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=UDnBLsrt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g3-20020a631103000000b005a9f776c59csi658702pgl.468.2023.10.31.00.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=UDnBLsrt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6D062807C55C; Tue, 31 Oct 2023 00:26:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343714AbjJaHZV (ORCPT + 99 others); Tue, 31 Oct 2023 03:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236654AbjJaHZG (ORCPT ); Tue, 31 Oct 2023 03:25:06 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1331EC2 for ; Tue, 31 Oct 2023 00:25:03 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9d224dca585so386936066b.1 for ; Tue, 31 Oct 2023 00:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1698737101; x=1699341901; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Yjxq8E7gNPB9bFCXU5zCmu0wTmIMA9QI7im5HIAGob8=; b=UDnBLsrtcgKp5mOUD4ecc0dAOd3RJlcwFDNGlrzk6roVkb4SMOz6fOy5llcqV8+LRs QExgROkLruoMEOZKOtmazcUJazusLavMTqgr+/zjHi3qnuUQumzTQfs+e6+yvZZA6h/9 7EViawuiKBERIA9HiNSH1PnJm1h7fyWiCEpgujnGDAFOUzrpATVXgmmZN1I3truXWvVr 7JpIAKFTgZSotkShgvxpc6kKNfxm3UlgSgksDJJ4BJmiIdc4nFpzbtF4iaNrSfGmQ9u2 JeJI3bRdFktDsWtJ0u10BgVOLFkWRGh+3mqiIxI8BIBwCfTuXLRpOHRZjr/yhg1MLMLb 5c4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698737101; x=1699341901; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Yjxq8E7gNPB9bFCXU5zCmu0wTmIMA9QI7im5HIAGob8=; b=mafNlSlwboxBHwOAzbrhYgnRuxEmvXfZWpdbL1y9px16GB5oq0AxWPrUo3uoAWfUbb VyDPogmAnJcgWtuWl7WT1IfOdon+0y22k3yhdAnq8W4nTlv4BUN2nzo7qDmCTELnpnC/ J58URgeAllTRf9tEOvCu1io5bs5BxIyxjZXcxqWMdpVmbonvTVYkwt+Ta78D0Ucg9IVh grjXZjuQDlNMS+orYoemoIhWxkzwbWsEvajRYx09vnyBWDi7Gm5pfIgqi414v820fxAX yqkMSuvWCbPoDLk0h+QkBXRiym6a8TXcRM4GpcIF1g7JZJE5+C7UIyPm/Uytj9d5D3rm s6aQ== X-Gm-Message-State: AOJu0Yym3qUaVRQIhBap36GwDAQAlCq4QBRkpXA4SavvV3DZBtLov/+1 +9dPmUTGMs2qVs1ylLLco49hSQ== X-Received: by 2002:a17:907:3184:b0:9c5:844f:a7f4 with SMTP id xe4-20020a170907318400b009c5844fa7f4mr9965783ejb.35.1698737101232; Tue, 31 Oct 2023 00:25:01 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.98]) by smtp.gmail.com with ESMTPSA id w3-20020a170906d20300b009b28ad521f4sm478828ejz.4.2023.10.31.00.25.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Oct 2023 00:25:00 -0700 (PDT) Message-ID: <48467507-877c-4789-85a9-932b0e79ed79@tuxon.dev> Date: Tue, 31 Oct 2023 09:24:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] ti: fix possible memory leak in _ti_omap4_clkctrl_setup() Content-Language: en-US To: Hangyu Hua , kristo@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, tony@atomide.com, dario.binacchi@amarulasolutions.com, claudiu.beznea@microchip.com, robh@kernel.org, andriy.shevchenko@linux.intel.com Cc: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231027025057.11510-1-hbh25y@gmail.com> From: claudiu beznea In-Reply-To: <20231027025057.11510-1-hbh25y@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 31 Oct 2023 00:26:02 -0700 (PDT) On 27.10.2023 05:50, Hangyu Hua wrote: > kstrndup() and kstrdup_and_replace() in clkctrl_get_name() can perform > dynamic memory allocation. So clkctrl_name() needs to be freed when s/clkctrl_name()/clkctrl_name > provider->clkdm_name is NULL. > > Fixes: bd46cd0b802d ("clk: ti: clkctrl: check return value of kasprintf()") > Signed-off-by: Hangyu Hua > --- > > v2: fix commit info. > > drivers/clk/ti/clkctrl.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c > index 607e34d8e289..cb4aa8a45bb2 100644 > --- a/drivers/clk/ti/clkctrl.c > +++ b/drivers/clk/ti/clkctrl.c > @@ -591,6 +591,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) > provider->clkdm_name = kasprintf(GFP_KERNEL, > "%s_clkdm", clkctrl_name); > if (!provider->clkdm_name) { > + kfree(clkctrl_name); > kfree(provider); > return; > }