From: Luca Ceresoli <luca@lucaceresoli.net>
To: Stephen Boyd <sboyd@kernel.org>, Adam Ford <aford173@gmail.com>,
linux-clk@vger.kernel.org
Cc: dan.carpenter@oracle.com, aford@beaconembedded.com,
Marek Vasut <marek.vasut@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] clk: vc5: Add memory check to prevent oops
Date: Tue, 21 Jul 2020 12:10:33 +0200 [thread overview]
Message-ID: <f6da2a16-0e6f-c865-dea3-f8b16c546f3f@lucaceresoli.net> (raw)
In-Reply-To: <159532318111.3847286.6874293188283317151@swboyd.mtv.corp.google.com>
Hi Stephen,
On 21/07/20 11:19, Stephen Boyd wrote:
> Quoting Adam Ford (2020-07-16 05:26:20)
>> When getting the names of the child nodes, kasprintf is used to
>> allocate memory which is used to create the string for the node
>> name. Unfortunately, there is no memory check to determine
>> if this allocation fails, it may cause an error when trying
>> to get child node name.
>>
>> This patch will check if the memory allocation fails, and returns
>> and -ENOMEM error instead of blindly moving on.
>>
>> Fixes: 260249f929e8 ("clk: vc5: Enable addition output configurations of the Versaclock")
>>
>> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Adam Ford <aford173@gmail.com>
>> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
>> ---
>> V3: Fix spelling error, and use the style of checking (!variable) instead of
>> (variable == NULL)
>>
>> V2: Fix an issue where a goto was going to use an unitialized variable.
>
> Is the patch from Colin also needed?
> https://lore.kernel.org/r/20200625132736.88832-1-colin.king@canonical.com
The two patches look completely orthogonal.
--
Luca
next prev parent reply other threads:[~2020-07-21 10:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 12:26 [PATCH V3] clk: vc5: Add memory check to prevent oops Adam Ford
2020-07-21 9:19 ` Stephen Boyd
2020-07-21 10:10 ` Luca Ceresoli [this message]
2020-07-23 1:46 ` 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=f6da2a16-0e6f-c865-dea3-f8b16c546f3f@lucaceresoli.net \
--to=luca@lucaceresoli.net \
--cc=aford173@gmail.com \
--cc=aford@beaconembedded.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).