linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: pakki001@umn.edu
Cc: kjlu@umn.edu, Marek Vasut <marek.vasut@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: Fix a missing check on regmap_bulk_read
Date: Wed, 09 Jan 2019 10:55:41 -0800	[thread overview]
Message-ID: <154706014175.15366.2565561612277733965@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20181224190032.23167-1-pakki001@umn.edu>

Quoting Aditya Pakki (2018-12-24 11:00:32)
> Currently, vc5_pll_recalc_rate() may produce incorrect output when
> regmap_bulk_read() fails. The fix checks the return value of the
> latter function and returns 0 in case of failure.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  drivers/clk/clk-versaclock5.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
> index decffb3826ec..cd76a893c594 100644
> --- a/drivers/clk/clk-versaclock5.c
> +++ b/drivers/clk/clk-versaclock5.c
> @@ -413,7 +413,8 @@ static unsigned long vc5_pll_recalc_rate(struct clk_hw *hw,
>         u32 div_int, div_frc;
>         u8 fb[5];
>  
> -       regmap_bulk_read(vc5->regmap, VC5_FEEDBACK_INT_DIV, fb, 5);
> +       if (regmap_bulk_read(vc5->regmap, VC5_FEEDBACK_INT_DIV, fb, 5))
> +               return 0;

There are a bunch of other regmap_*() APIs in here that "could fail".
Why has this one been chosen but the other ones not?


  reply	other threads:[~2019-01-09 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-24 19:00 [PATCH] clk: Fix a missing check on regmap_bulk_read Aditya Pakki
2019-01-09 18:55 ` Stephen Boyd [this message]
2019-01-09 21:22 ` Marek Vasut

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=154706014175.15366.2565561612277733965@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=pakki001@umn.edu \
    /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).