linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: "Stephen Boyd" <sboyd@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	linux-clk@vger.kernel.org
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: clk: actions: Don't reference clk_init_data after registration [bug report]
Date: Fri, 16 Aug 2019 23:31:11 +0100	[thread overview]
Message-ID: <7132b72b-bd73-f53f-8966-a9b88dd444e4@canonical.com> (raw)

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

                 reply	other threads:[~2019-08-16 22:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7132b72b-bd73-f53f-8966-a9b88dd444e4@canonical.com \
    --to=colin.king@canonical.com \
    --cc=afaerber@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.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 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).