linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Adam Ford <aford173@gmail.com>, linux-clk@vger.kernel.org
Cc: dan.carpenter@oracle.com, luca@lucaceresoli.net,
	aford@beaconembedded.com, Adam Ford <aford173@gmail.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 02:19:41 -0700	[thread overview]
Message-ID: <159532318111.3847286.6874293188283317151@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20200716122620.4538-1-aford173@gmail.com>

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

  reply	other threads:[~2020-07-21  9:19 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 [this message]
2020-07-21 10:10   ` Luca Ceresoli
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=159532318111.3847286.6874293188283317151@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --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=luca@lucaceresoli.net \
    --cc=marek.vasut@gmail.com \
    --cc=mturquette@baylibre.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;
as well as URLs for NNTP newsgroup(s).