Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* Potential uninitialized variable "reg" in clk: axi-clkgen
@ 2019-10-10  0:55 Yizhuo Zhai
  2019-11-08 22:28 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Yizhuo Zhai @ 2019-10-10  0:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
	Zhiyun Qian, Chengyu Song

Hi All:
drivers/clk/clk-axi-clkgen.c:

Inside function axi_clkgen_recalc_rate(), variable "reg" could be
uninitialized if axi_clkgen_mmcm_read() fails. However, "reg" is used
to decide the control flow later in the if statement, which is
potentially unsafe.

The patch for this case is not easy since the error return is not an
acceptable return value for axi_clkgen_recalc_rate().

-- 
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside

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

* Re: Potential uninitialized variable "reg" in clk: axi-clkgen
  2019-10-10  0:55 Potential uninitialized variable "reg" in clk: axi-clkgen Yizhuo Zhai
@ 2019-11-08 22:28 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-11-08 22:28 UTC (permalink / raw)
  To: Chengyu Song, Michael Turquette, Yizhuo Zhai, Zhiyun Qian,
	linux-clk, linux-kernel

Quoting Yizhuo Zhai (2019-10-09 17:55:06)
> Hi All:
> drivers/clk/clk-axi-clkgen.c:
> 
> Inside function axi_clkgen_recalc_rate(), variable "reg" could be
> uninitialized if axi_clkgen_mmcm_read() fails. However, "reg" is used
> to decide the control flow later in the if statement, which is
> potentially unsafe.
> 
> The patch for this case is not easy since the error return is not an
> acceptable return value for axi_clkgen_recalc_rate().
> 

I think we will do nothing unless you send some sort of patch. Sorry.


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  0:55 Potential uninitialized variable "reg" in clk: axi-clkgen Yizhuo Zhai
2019-11-08 22:28 ` Stephen Boyd

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git