Re: [bug report] clk: tegra: Add BPMP clock driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux