SUPERH platform development
 help / color / mirror / Atom feed
* re: sh: add clk_round_parent() to optimize parent clock rate
@ 2013-11-06 16:14 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-11-06 16:14 UTC (permalink / raw)
  To: linux-sh

Hello Guennadi Liakhovetski,

This is a semi-automatic email about new static checker warnings.

The patch 6af26c6c99f0: "sh: add clk_round_parent() to optimize 
parent clock rate" from Nov 2, 2010, leads to the following Smatch 
complaint:

drivers/sh/clk/core.c:641 clk_round_parent()
	 error: we previously assumed 'best_freq' could be null (see line 630)

drivers/sh/clk/core.c
   629				best = freq;
   630				if (best_freq)
   631					*best_freq = freq_high;
   632			}
   633	
   634			if (target - freq_low < error) {
   635				error = target - freq_low;
   636				best = freq;
   637				if (best_freq)
                                    ^^^^^^^^^
Check.

   638					*best_freq = freq_low;
   639			}
   640	
   641			pr_debug("%u / %lu = %lu, / %lu = %lu, best %lu, parent %u\n",
   642				 freq->frequency, div, freq_high, div + 1, freq_low,
   643				 *best_freq, best->frequency);
                                 ^^^^^^^^^^
Unchecked dereference.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-06 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 16:14 sh: add clk_round_parent() to optimize parent clock rate Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox