lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160416000443.GA26353@codeaurora.org>
Date:	Fri, 15 Apr 2016 17:04:43 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:	linux-mips@...ux-mips.org, Rich Felker <dalias@...c.org>,
	linux-sh@...r.kernel.org,
	Michael Turquette <mturquette@...libre.com>,
	Greg Ungerer <gerg@...inux.org>, linux-clk@...r.kernel.org,
	Russell King <linux@....linux.org.uk>,
	Yoshinori Sato <ysato@...rs.sourceforge.jp>,
	Magnus Damm <magnus.damm@...il.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Wan ZongShun <mcuos.com@...il.com>,
	Steven Miao <realmz6@...il.com>,
	adi-buildroot-devel@...ts.sourceforge.net,
	Haojian Zhuang <haojian.zhuang@...il.com>,
	linux-m68k@...ts.linux-m68k.org, Simon Horman <horms@...ge.net.au>,
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
	John Crispin <blogic@...nwrt.org>,
	Eric Miao <eric.y.miao@...il.com>,
	Ryan Mallon <rmallon@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ralf Baechle <ralf@...ux-mips.org>,
	linux-renesas-soc@...r.kernel.org,
	Hartley Sweeten <hsweeten@...ionengravers.com>
Subject: Re: [PATCH v2] clk: let clk_disable() return immediately if clk is
 NULL or error

On 04/14, Masahiro Yamada wrote:
> 
> OK, now I notice another problem in my code;
> if foo_clk_init() fails for reason [2],
> clk_disable() WARN's due to zero enable_count.
> 
> if (WARN_ON(core->enable_count == 0))
>          return;
> 
> 
> 
> Perhaps, I got screwed up by splitting clock init stuff
> into a helper function.

Yep! Can't we just split the enable/disable out into another
function separate from the clk_get/put part? That would make
things more symmetric and avoid this problem.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ