All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: lars@metafoo.de, dan.carpenter@oracle.com, ssantosh@kernel.org,
	mturquette@baylibre.com, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/3] clk: keystone: Fix an error checking
Date: Wed, 02 Nov 2016 00:22:29 +0000	[thread overview]
Message-ID: <20161102002228.GC16026@codeaurora.org> (raw)
In-Reply-To: <ff1de6a7af60b4e3804162e553d7174e2ad1ea16.1477339880.git.christophe.jaillet@wanadoo.fr>

On 10/24, Christophe JAILLET wrote:
> clk_register_pll() can return ERR_PTR(-ENOMEM) so checking the return value
> against NULL only is not correct.

The code just doesn't propagate the error up to the caller.
Instead the caller treats NULL as an error and non-NULL as valid.
If the callee detects an error it hides it and returns NULL.

> In order to fix it, update clk_register_pll() to always return an error
> pointer in case of error and check the return value with IS_ERR.
> 
> While at it, also fix a tab vs space in the surrounding code.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-compiled and un-tested.

Please at least compile test patches.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@codeaurora.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: lars@metafoo.de, dan.carpenter@oracle.com, ssantosh@kernel.org,
	mturquette@baylibre.com, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/3] clk: keystone: Fix an error checking
Date: Tue, 1 Nov 2016 17:22:29 -0700	[thread overview]
Message-ID: <20161102002228.GC16026@codeaurora.org> (raw)
In-Reply-To: <ff1de6a7af60b4e3804162e553d7174e2ad1ea16.1477339880.git.christophe.jaillet@wanadoo.fr>

On 10/24, Christophe JAILLET wrote:
> clk_register_pll() can return ERR_PTR(-ENOMEM) so checking the return value
> against NULL only is not correct.

The code just doesn't propagate the error up to the caller.
Instead the caller treats NULL as an error and non-NULL as valid.
If the callee detects an error it hides it and returns NULL.

> In order to fix it, update clk_register_pll() to always return an error
> pointer in case of error and check the return value with IS_ERR.
> 
> While at it, also fix a tab vs space in the surrounding code.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-compiled and un-tested.

Please at least compile test patches.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-11-02  0:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 20:43 [PATCH 0/3] clk: keystone: Fix some error handling paths Christophe JAILLET
2016-10-24 20:43 ` Christophe JAILLET
2016-10-24 20:43 ` [PATCH 1/3] clk: keystone: Fix an error checking Christophe JAILLET
2016-10-24 20:43   ` Christophe JAILLET
2016-11-02  0:22   ` Stephen Boyd [this message]
2016-11-02  0:22     ` Stephen Boyd
2016-11-04  5:43     ` Christophe JAILLET
2016-11-04  5:43       ` Christophe JAILLET
2016-10-24 20:43 ` [PATCH 2/3] clk: keystone: Fix some error messages Christophe JAILLET
2016-10-24 20:43   ` Christophe JAILLET
2016-10-24 20:43 ` [PATCH 3/3] clk: keystone: Fix missing iounmap calls in an error handling path Christophe JAILLET
2016-10-24 20:43   ` Christophe JAILLET
2016-10-25  7:08   ` walter harms
2016-10-25  7:08     ` walter harms
2016-10-25 20:35     ` Stephen Boyd
2016-10-25 20:35       ` Stephen Boyd
2016-10-26 12:14   ` walter harms
2016-10-28  0:19   ` 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=20161102002228.GC16026@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=ssantosh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.