From: Dmitry Osipenko <digetx@gmail.com>
To: Stephen Boyd <sboyd@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
"Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>,
Michael Turquette <mturquette@baylibre.com>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>,
linux-clk <linux-clk@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-tegra <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH 1/1] clk: tegra: tegra124-emc: Fix possible memory leak
Date: Mon, 28 Jun 2021 03:29:20 +0300 [thread overview]
Message-ID: <5eb50fd9-1de9-cc61-6443-d84999e22803@gmail.com> (raw)
In-Reply-To: <162483744494.3259633.12565750309559171999@swboyd.mtv.corp.google.com>
28.06.2021 02:44, Stephen Boyd пишет:
> Quoting Leizhen (ThunderTown) (2021-06-25 18:32:46)
>>
>>
>> On 2021/6/26 7:31, Stephen Boyd wrote:
>>> Quoting Zhen Lei (2021-06-17 01:27:59)
>>>> When krealloc() fails to expand the memory and returns NULL, the original
>>>> memory is not released. In this case, the original "timings" scale should
>>>> be maintained.
>>>>
>>>> Fixes: 888ca40e2843 ("clk: tegra: emc: Support multiple RAM codes")
The memory is still not released on error and this is not the only one
place in that code which doesn't release memory on error.
All this code is executed only once during early kernel boot, perhaps
not really worthwhile fixing it or at least this should be done properly.
>>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>>> ---
>>>
>>> Looks correct, but when does krealloc() return NULL? My read of the
>>> kerneldoc is that it would return the original memory if the new
>>> allocation "failed".
>>
>> That must be the wrong description in the document. For example, the original
>
> Can you fix the kernel doc then?
>
The doc is clearly saying that it returns NULL, am I missing something?
* Return: pointer to the allocated memory or %NULL in case of error
next prev parent reply other threads:[~2021-06-28 0:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 8:27 Zhen Lei
2021-06-25 23:31 ` Stephen Boyd
2021-06-26 1:32 ` Leizhen (ThunderTown)
2021-06-27 23:44 ` Stephen Boyd
2021-06-28 0:29 ` Dmitry Osipenko [this message]
2021-06-28 1:52 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5eb50fd9-1de9-cc61-6443-d84999e22803@gmail.com \
--to=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pdeschrijver@nvidia.com \
--cc=pgaikwad@nvidia.com \
--cc=sboyd@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=thunder.leizhen@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®