All of lore.kernel.org
 help / color / mirror / Atom feed
* re: clk: actions: Don't reference clk_init_data after registration [bug report]
@ 2019-08-16 22:31 Colin Ian King
  2019-08-17  3:44 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2019-08-16 22:31 UTC (permalink / raw)
  To: Stephen Boyd, Manivannan Sadhasivam, Andreas Färber,
	Michael Turquette, linux-arm-kernel@lists.infradead.org,
	linux-clk
  Cc: linux-kernel@vger.kernel.org

Hi,

Static analysis with Coverity Scan on linux-next has found an issue with
the following commit:

commit 20cac6d02815edcc0b1c87bc3e8858b3d1fda3fa
Author: Stephen Boyd <sboyd@kernel.org>
Date:   Wed Jul 31 12:35:09 2019 -0700

    clk: actions: Don't reference clk_init_data after registration

The analysis is as follows:

7        int i, ret;

  1. var_decl: Declaring variable hw without initializer.

68        struct clk_hw *hw;
69

  2. Condition i < hw_clks->num, taking true branch.

70        for (i = 0; i < hw_clks->num; i++) {

  CID 85252 (#1 of 1): Uninitialized pointer read (UNINIT)
  3. uninit_use:  Using uninitialized value hw.

71                const char *name = hw->init->name;
72
73                hw = hw_clks->hws[i];

hw is being dereferenced on line 71 however it is not assigned until
line 73.

Did you instead intent this to be:

		const char *name;

		hw = hw_clks->hws[i];
		name = hw->init->name;

Colin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* re: clk: actions: Don't reference clk_init_data after registration [bug report]
  2019-08-16 22:31 clk: actions: Don't reference clk_init_data after registration [bug report] Colin Ian King
@ 2019-08-17  3:44 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-08-17  3:44 UTC (permalink / raw)
  To: linux-arm-kernel@lists.infradead.org, Andreas Färber,
	Colin Ian King, Manivannan Sadhasivam, Michael Turquette,
	linux-clk
  Cc: linux-kernel@vger.kernel.org

Quoting Colin Ian King (2019-08-16 15:31:11)
> Hi,
> 
> Static analysis with Coverity Scan on linux-next has found an issue with
> the following commit:

Thanks, it's already been fixed.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-17  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-16 22:31 clk: actions: Don't reference clk_init_data after registration [bug report] Colin Ian King
2019-08-17  3:44 ` Stephen Boyd

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.