From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 496AF7C for ; Sun, 24 Apr 2022 02:46:02 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 375BB5C00BA; Sat, 23 Apr 2022 22:46:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 23 Apr 2022 22:46:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1650768361; x= 1650854761; bh=8Q+ZFt8iLKfw6+gfcY5JTvb5tFIFfrs8cTxnzQhZJ9s=; b=c gybfw8PKzGPaM5ziDhBstmzJgZD9tE6ddGyMu7qOKe2RvB4Cv5bjTUKdCIB/khBN jHBUS/MLaiAS1GSlzDdpwmVZ3Mawe/ufGJCJObgoDyCOeXLqfqxAvqj2XHPlSE+B K3tSvJkeHXMVj+SKPRPOC8i0nXkcwIsTh1b+bvK49Xw5f9MYd5Fm39lzoccdjwqR ZapBY92I9ofh7CsBZ56NabWbWUXPhjV9KeNzDwqit0L0dxM6kosZJ5Z153lpaMoY kL+J8puHGexO6qdiz8kXuvqMStl/XOLt2079x46nNfUlqmGP1D8Qlf+CVU3uS+AR /pDQ8aRYvSV+KQIFy7UmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1650768361; x=1650854761; bh=8Q+ZFt8iLKfw6 +gfcY5JTvb5tFIFfrs8cTxnzQhZJ9s=; b=pg2o/IZLhelFZ7d1s17VVUHpfzBFU +PYgd5T/PxajgWhYPghjoX5VSEDL2aR86SOSQXSbKD2HiZc5IsGtX8ZdD3aAXx5p QHvXqrRqG4suPJmkUNsXF2fZHnc7gD7miiJm33Dkm/ip8Id3Y19M7MtY36+2jUgt bUPBul5fafOBbIMYEVTcrNJ3htZaez1JP4yXqFs5zZXJ5S9+MSH5K7kUmYMiUiLp vG9f9dQSLyH7ZASnK2rwKDgNrAUkEuuxYrVgDeuDyLyuew0x2hOdzkeL+pgg0Pbu Q2PHoVOAS1DpSUkSYfnbpASPQ88vvKR8tENPrhl/U1U/BYMq4fjGNHlDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrtdejgdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfevfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepffdtveekvdegkeeuueetgfetffeileevudekuefhheelvdfhiedt heduhfduhefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Apr 2022 22:46:00 -0400 (EDT) Subject: Re: [PATCH v2] cpufreq:fix memory leak in sun50i_cpufreq_nvmem_probe To: Xiaobing Luo , tiny.windzz@gmail.com, rafael@kernel.org, viresh.kumar@linaro.org, wens@csie.org, jernej.skrabec@gmail.com, mripard@kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220423151204.2102314-1-luoxiaobing0926@gmail.com> From: Samuel Holland Message-ID: <4ee2421f-79a8-7f4d-f7ef-33f0ccf49337@sholland.org> Date: Sat, 23 Apr 2022 21:46:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20220423151204.2102314-1-luoxiaobing0926@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 4/23/22 10:12 AM, Xiaobing Luo wrote: > -------------------------------------------- > unreferenced object 0xffff000010742a00 (size 128): > comm "swapper/0", pid 1, jiffies 4294902015 (age 1187.652s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [<00000000b4dfebaa>] __kmalloc+0x338/0x474 > [<00000000d6e716db>] sun50i_cpufreq_nvmem_probe+0xc4/0x36c > [<000000007d6082a0>] platform_probe+0x98/0x11c > [<00000000c990f549>] really_probe+0x234/0x5a0 > [<000000002d9fecc6>] __driver_probe_device+0x194/0x224 > [<00000000cf0b94fa>] driver_probe_device+0x64/0x13c > [<00000000f238e4cf>] __device_attach_driver+0xf8/0x180 > [<000000006720e418>] bus_for_each_drv+0xf8/0x160 > [<00000000df4f14f6>] __device_attach+0x174/0x29c > [<00000000782002fb>] device_initial_probe+0x20/0x30 > [<00000000c2681b06>] bus_probe_device+0xfc/0x110 > [<00000000964cf3bd>] device_add+0x5f0/0xcd0 > [<000000004b9264e3>] platform_device_add+0x198/0x390 > [<00000000fa82a9d0>] platform_device_register_full+0x178/0x210 > [<000000009a5daf13>] sun50i_cpufreq_init+0xf8/0x168 > [<000000000377cc7c>] do_one_initcall+0xe4/0x570 > -------------------------------------------- > > if sun50i_cpufreq_get_efuse failed, then opp_tables leak. > Fixes: f328584f7bff ("cpufreq: Add sun50i nvmem based CPU scaling driver") > > Signed-off-by: Xiaobing Luo Two minor style issues: there should be a space after "cpufreq:" in the commit subject. And the blank line should come before the "Fixes:" tag, not after. Otherwise: Reviewed-by: Samuel Holland > --- > drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > index 2deed8d8773f..75e1bf3a08f7 100644 > --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > @@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) > return -ENOMEM; > > ret = sun50i_cpufreq_get_efuse(&speed); > - if (ret) > + if (ret) { > + kfree(opp_tables); > return ret; > + } > > snprintf(name, MAX_NAME_LEN, "speed%d", speed); > > 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 55AC2C433EF for ; Sun, 24 Apr 2022 02:47:09 +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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yX+3yqzHwtIKATmkNXVn0V5tB57Afkq1zJYs1li4lG0=; b=dSvYDQmSUtn4GZZtgonrqu3Lws 6yCo10uwn0WLLreG2puFeAkoShfOoOP12YN+p9SPz2cMCbnrctGxHY8T+Dkp1RM3n4BN4Hc67lpMd webge9D0nW+LvASv71nuNKixOnJL4bnZfMIqBZqg9yPlBCFynB6NeCrTGSPv2abDvqB4myvY4n8ev XcrtYKyoVH6COoKsU1+HgWQIExLopaSwb2hNv+xpD0EmJMpBrokMKhYWbMF2BsyYZfmT4QZhSAw8i 0vCjlRYhaz72rRMKhVAsDYHLpwHeBJS6KfUlTnFw4/BUWJazjEYIwebkMDPUMVLWcKsnngk4/8Ftb gJEs6PLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1niSGE-005b5G-29; Sun, 24 Apr 2022 02:46:06 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1niSGA-005b4q-9l for linux-arm-kernel@lists.infradead.org; Sun, 24 Apr 2022 02:46:03 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 375BB5C00BA; Sat, 23 Apr 2022 22:46:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 23 Apr 2022 22:46:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1650768361; x= 1650854761; bh=8Q+ZFt8iLKfw6+gfcY5JTvb5tFIFfrs8cTxnzQhZJ9s=; b=c gybfw8PKzGPaM5ziDhBstmzJgZD9tE6ddGyMu7qOKe2RvB4Cv5bjTUKdCIB/khBN jHBUS/MLaiAS1GSlzDdpwmVZ3Mawe/ufGJCJObgoDyCOeXLqfqxAvqj2XHPlSE+B K3tSvJkeHXMVj+SKPRPOC8i0nXkcwIsTh1b+bvK49Xw5f9MYd5Fm39lzoccdjwqR ZapBY92I9ofh7CsBZ56NabWbWUXPhjV9KeNzDwqit0L0dxM6kosZJ5Z153lpaMoY kL+J8puHGexO6qdiz8kXuvqMStl/XOLt2079x46nNfUlqmGP1D8Qlf+CVU3uS+AR /pDQ8aRYvSV+KQIFy7UmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1650768361; x=1650854761; bh=8Q+ZFt8iLKfw6 +gfcY5JTvb5tFIFfrs8cTxnzQhZJ9s=; b=pg2o/IZLhelFZ7d1s17VVUHpfzBFU +PYgd5T/PxajgWhYPghjoX5VSEDL2aR86SOSQXSbKD2HiZc5IsGtX8ZdD3aAXx5p QHvXqrRqG4suPJmkUNsXF2fZHnc7gD7miiJm33Dkm/ip8Id3Y19M7MtY36+2jUgt bUPBul5fafOBbIMYEVTcrNJ3htZaez1JP4yXqFs5zZXJ5S9+MSH5K7kUmYMiUiLp vG9f9dQSLyH7ZASnK2rwKDgNrAUkEuuxYrVgDeuDyLyuew0x2hOdzkeL+pgg0Pbu Q2PHoVOAS1DpSUkSYfnbpASPQ88vvKR8tENPrhl/U1U/BYMq4fjGNHlDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrtdejgdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfevfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepffdtveekvdegkeeuueetgfetffeileevudekuefhheelvdfhiedt heduhfduhefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Apr 2022 22:46:00 -0400 (EDT) Subject: Re: [PATCH v2] cpufreq:fix memory leak in sun50i_cpufreq_nvmem_probe To: Xiaobing Luo , tiny.windzz@gmail.com, rafael@kernel.org, viresh.kumar@linaro.org, wens@csie.org, jernej.skrabec@gmail.com, mripard@kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220423151204.2102314-1-luoxiaobing0926@gmail.com> From: Samuel Holland Message-ID: <4ee2421f-79a8-7f4d-f7ef-33f0ccf49337@sholland.org> Date: Sat, 23 Apr 2022 21:46:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20220423151204.2102314-1-luoxiaobing0926@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220423_194602_636091_B9126740 X-CRM114-Status: GOOD ( 15.08 ) 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 On 4/23/22 10:12 AM, Xiaobing Luo wrote: > -------------------------------------------- > unreferenced object 0xffff000010742a00 (size 128): > comm "swapper/0", pid 1, jiffies 4294902015 (age 1187.652s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [<00000000b4dfebaa>] __kmalloc+0x338/0x474 > [<00000000d6e716db>] sun50i_cpufreq_nvmem_probe+0xc4/0x36c > [<000000007d6082a0>] platform_probe+0x98/0x11c > [<00000000c990f549>] really_probe+0x234/0x5a0 > [<000000002d9fecc6>] __driver_probe_device+0x194/0x224 > [<00000000cf0b94fa>] driver_probe_device+0x64/0x13c > [<00000000f238e4cf>] __device_attach_driver+0xf8/0x180 > [<000000006720e418>] bus_for_each_drv+0xf8/0x160 > [<00000000df4f14f6>] __device_attach+0x174/0x29c > [<00000000782002fb>] device_initial_probe+0x20/0x30 > [<00000000c2681b06>] bus_probe_device+0xfc/0x110 > [<00000000964cf3bd>] device_add+0x5f0/0xcd0 > [<000000004b9264e3>] platform_device_add+0x198/0x390 > [<00000000fa82a9d0>] platform_device_register_full+0x178/0x210 > [<000000009a5daf13>] sun50i_cpufreq_init+0xf8/0x168 > [<000000000377cc7c>] do_one_initcall+0xe4/0x570 > -------------------------------------------- > > if sun50i_cpufreq_get_efuse failed, then opp_tables leak. > Fixes: f328584f7bff ("cpufreq: Add sun50i nvmem based CPU scaling driver") > > Signed-off-by: Xiaobing Luo Two minor style issues: there should be a space after "cpufreq:" in the commit subject. And the blank line should come before the "Fixes:" tag, not after. Otherwise: Reviewed-by: Samuel Holland > --- > drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > index 2deed8d8773f..75e1bf3a08f7 100644 > --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > @@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) > return -ENOMEM; > > ret = sun50i_cpufreq_get_efuse(&speed); > - if (ret) > + if (ret) { > + kfree(opp_tables); > return ret; > + } > > snprintf(name, MAX_NAME_LEN, "speed%d", speed); > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel