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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 05 Aug 2016 10:29:39 +0200
From:	Sylwester Nawrocki <s.nawrocki@...sung.com>
To:	Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:	Stephen Boyd <sboyd@...eaurora.org>, linux-clk@...r.kernel.org,
	Michael Turquette <mturquette@...libre.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: prevent __of_clk_get_hw_from_provider() from
 returning NULL

On 08/04/2016 10:57 PM, Stephen Boyd wrote:
> On 07/19, Masahiro Yamada wrote:
>> > The .get(_hw) callback of an OF clock provider can return a NULL
>> > pointer in some cases.
>> > 
>> > For example, of_clk_src_onecell_get() returns NULL for index 1 of a
>> > sparse array of clocks like follows:
>> > 
>> >   clk_num == 3
>> >   idx 0: UART clk
>> >   idx 1: NULL (no clk is allocated)
>> >   idx 2: I2C clk
>> > 
>> > In such cases, clk_get() successfully returns NULL.

I remember running into same issue before, we have addressed
it by initializing the array of clocks with some errno value,
e.g ERR_PTR(-ENOENT), so there is no chance to get NULL from
the array - either a valid clk pointer or an ERR_PTR() value.

--
Thanks,
Sylwester

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ