From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: at91: fix check of clk_register() returned value
Date: Tue, 8 Mar 2016 12:33:46 +0100 [thread overview]
Message-ID: <20160308123346.656228de@bbrezillon> (raw)
In-Reply-To: <20160308030600.GA5845@piout.net>
On Tue, 8 Mar 2016 04:06:00 +0100
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:
> On 08/03/2016 at 01:41:29 +0200, Vladimir Zapolskiy wrote :
> > The clk_register() function returns a valid pointer to struct clk or
> > ERR_PTR() error code, this makes a check for returned NULL value
> > useless and may lead to oops on error path.
> >
> > Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>
> > ---
> > Alexandre, Boris,
> >
> > I've seen your recent huge updates to the driver, but I haven't found
> > them in clk-next, I hope that this trivial fix against clk-next won't
> > cause a big pain on rebase.
> >
>
> They went through arm-soc and should have been in linux-next for a while
> now.
>
> > drivers/clk/at91/clk-h32mx.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
> > index 61566bc..a165230 100644
> > --- a/drivers/clk/at91/clk-h32mx.c
> > +++ b/drivers/clk/at91/clk-h32mx.c
> > @@ -116,7 +116,7 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
> > h32mxclk->pmc = pmc;
> >
> > clk = clk_register(NULL, &h32mxclk->hw);
> > - if (!clk) {
> > + if (IS_ERR(clk)) {
> > kfree(h32mxclk);
> > return;
> > }
> > --
> > 2.1.4
> >
>
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-03-08 11:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 23:41 [PATCH] clk: at91: fix check of clk_register() returned value Vladimir Zapolskiy
2016-03-08 3:06 ` Alexandre Belloni
2016-03-08 11:33 ` Boris Brezillon [this message]
2016-04-15 23:57 ` 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=20160308123346.656228de@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@codeaurora.org \
--cc=vz@mleia.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