All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [mripard:vc4/rework-helpers 12/28] drivers/clk/clk.c:2385 clk_set_min_rate() warn: variable dereferenced before check 'clk' (see line 2383)
Date: Mon, 16 Nov 2020 12:20:16 +0300	[thread overview]
Message-ID: <20201116092016.GS29398@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git vc4/rework-helpers
head:   0b08b344d2e1241f8135321b3e0421d95d855bc6
commit: 1f25a431c207a9f4e9024f8285b8a97654e78f39 [12/28] clk: trace: Trace range functions
config: i386-randconfig-m021-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/clk/clk.c:2385 clk_set_min_rate() warn: variable dereferenced before check 'clk' (see line 2383)

vim +/clk +2385 drivers/clk/clk.c

4dff95dc9477a34 Stephen Boyd  2015-04-30  2381  int clk_set_min_rate(struct clk *clk, unsigned long rate)
035a61c314eb3da Tomeu Vizoso  2015-01-23  2382  {
1f25a431c207a9f Maxime Ripard 2020-10-01 @2383  	trace_clk_set_min_rate(clk->core, rate);
                                                                               ^^^^^^^^^
Derefenced

1f25a431c207a9f Maxime Ripard 2020-10-01  2384  
035a61c314eb3da Tomeu Vizoso  2015-01-23 @2385  	if (!clk)
                                                            ^^^^
Checked too late.

035a61c314eb3da Tomeu Vizoso  2015-01-23  2386  		return 0;
035a61c314eb3da Tomeu Vizoso  2015-01-23  2387  
4dff95dc9477a34 Stephen Boyd  2015-04-30  2388  	return clk_set_rate_range(clk, rate, clk->max_rate);
035a61c314eb3da Tomeu Vizoso  2015-01-23  2389  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30687 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [mripard:vc4/rework-helpers 12/28] drivers/clk/clk.c:2385 clk_set_min_rate() warn: variable dereferenced before check 'clk' (see line 2383)
Date: Mon, 16 Nov 2020 12:20:16 +0300	[thread overview]
Message-ID: <20201116092016.GS29398@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git vc4/rework-helpers
head:   0b08b344d2e1241f8135321b3e0421d95d855bc6
commit: 1f25a431c207a9f4e9024f8285b8a97654e78f39 [12/28] clk: trace: Trace range functions
config: i386-randconfig-m021-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/clk/clk.c:2385 clk_set_min_rate() warn: variable dereferenced before check 'clk' (see line 2383)

vim +/clk +2385 drivers/clk/clk.c

4dff95dc9477a34 Stephen Boyd  2015-04-30  2381  int clk_set_min_rate(struct clk *clk, unsigned long rate)
035a61c314eb3da Tomeu Vizoso  2015-01-23  2382  {
1f25a431c207a9f Maxime Ripard 2020-10-01 @2383  	trace_clk_set_min_rate(clk->core, rate);
                                                                               ^^^^^^^^^
Derefenced

1f25a431c207a9f Maxime Ripard 2020-10-01  2384  
035a61c314eb3da Tomeu Vizoso  2015-01-23 @2385  	if (!clk)
                                                            ^^^^
Checked too late.

035a61c314eb3da Tomeu Vizoso  2015-01-23  2386  		return 0;
035a61c314eb3da Tomeu Vizoso  2015-01-23  2387  
4dff95dc9477a34 Stephen Boyd  2015-04-30  2388  	return clk_set_rate_range(clk, rate, clk->max_rate);
035a61c314eb3da Tomeu Vizoso  2015-01-23  2389  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30687 bytes --]

             reply	other threads:[~2020-11-16  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16  9:20 Dan Carpenter [this message]
2020-11-16  9:20 ` [mripard:vc4/rework-helpers 12/28] drivers/clk/clk.c:2385 clk_set_min_rate() warn: variable dereferenced before check 'clk' (see line 2383) Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-11-14 15:15 kernel test robot

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=20201116092016.GS29398@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.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.