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:	Mon, 11 Mar 2013 09:14:42 +0530
From:	amit kachhap <amit.kachhap@...il.com>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Kukjin Kim <kgene.kim@...sung.com>, linux-pm@...r.kernel.org,
	Viresh Kumar <viresh.kumar@...aro.org>,
	linux-kernel@...r.kernel.org, cpufreq@...r.kernel.org,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	linux-samsung-soc@...r.kernel.org,
	Thomas Abraham <thomas.abraham@...aro.org>,
	Inderpal Singh <inderpal.singh@...aro.org>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440

Hi Russell,

On Thu, Mar 7, 2013 at 9:07 PM, Russell King - ARM Linux
<linux@....linux.org.uk> wrote:
> On Thu, Mar 07, 2013 at 04:28:00PM +0100, Sylwester Nawrocki wrote:
>> On 03/07/2013 05:13 AM, Amit Daniel Kachhap wrote:
>> > +   dvfs_info->cpu_clk = devm_clk_get(dvfs_info->dev, "armclk");
>> > +   if (IS_ERR_OR_NULL(dvfs_info->cpu_clk)) {
>>
>> devm_clk_get() return value needs to be checked with IS_ERR(),
>> not IS_ERR_OR_NULL().
>>
>> > +           pr_err("Failed to get cpu clock\n");
>> > +           ret = PTR_ERR(dvfs_info->cpu_clk);
>> > +           goto err_free_table;
>
> Amit, to illustrate why this is wrong, consider this:
> 1. Set cpu_clk to NULL.
> 2. Realise IS_ERR_OR_NULL(NULL) is true.
> 3. What is the value of PTR_ERR(NULL) ?
> 4. What effect does that have when you jump to err_free_table ?
> 5. What value is returned from this function in that case ?
> 6. What does that return value mean to the driver core ?

Thanks for the detailed explaination. Usage of IS_ERR_OR_NULL is not
suitable here.

Thanks,
Amit D
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ