All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [bug report] clk: tegra: Add BPMP clock driver
Date: Thu, 17 Nov 2016 18:25:28 +0100	[thread overview]
Message-ID: <20161117172526.GA20185@ulmo.ba.sec> (raw)
In-Reply-To: <20161117125645.GA32763@mwanda>

[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]

Hi Dan,

On Thu, Nov 17, 2016 at 03:59:54PM +0300, Dan Carpenter wrote:
> Hello Thierry Reding,
> 
> The patch 569d53d81e37: "clk: tegra: Add BPMP clock driver" from Aug
> 18, 2016, leads to the following static checker warning:
> 
> 	drivers/clk/tegra/clk-bpmp.c:183 tegra_bpmp_clk_get_parent()
> 	warn: sizeof(&pointer)?
> 
> drivers/clk/tegra/clk-bpmp.c
>    171  static u8 tegra_bpmp_clk_get_parent(struct clk_hw *hw)
>    172  {
>    173          struct tegra_bpmp_clk *clk = to_tegra_bpmp_clk(hw);
>    174          struct cmd_clk_get_parent_response response;
>    175          struct tegra_bpmp_clk_message msg;
>    176          unsigned int i;
>    177          int err;
>    178  
>    179          memset(&msg, 0, sizeof(msg));
>    180          msg.cmd = CMD_CLK_GET_PARENT;
>    181          msg.clk = clk->id;
>    182          msg.rx.data = &response;
>    183          msg.rx.size = sizeof(&response);
> 
> This should almost certainly sizeof(response). int vs pointer.
> 
>    184  
>    185          err = tegra_bpmp_clk_transfer(clk->bpmp, &msg);
>    186          if (err < 0) {
>    187                  dev_err(clk->bpmp->dev, "failed to get parent for %s: %d\n",

Mike pointed that out during review and I've fixed it since then. I
assume that this worked fine because we were accidentally ovewriting
something on the stack that we no longer used (perhaps the following
msg variable?).

Thanks for reporting,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      reply	other threads:[~2016-11-17 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 12:59 [bug report] clk: tegra: Add BPMP clock driver Dan Carpenter
2016-11-17 17:25 ` Thierry Reding [this message]

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=20161117172526.GA20185@ulmo.ba.sec \
    --to=treding-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.