lkml.org 
[lkml]   [2019]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectre: clk: actions: Don't reference clk_init_data after registration [bug report]
Date
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

\
 
 \ /
  Last update: 2019-08-17 00:31    [W:0.038 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site