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]
Date:	Mon, 20 Feb 2012 22:41:30 -0800
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: Clean up debugfs error handling a bit

On 2/20/2012 1:15 PM, Mark Brown wrote:
> Use IS_ERR_OR_NULL() rather than open coding it and ignore errors from
> failure to create the supply map.

Reported-by: Stephen Boyd <sboyd@...eaurora.org>

>
> Signed-off-by: Mark Brown<broonie@...nsource.wolfsonmicro.com>

>
> @@ -3231,14 +3231,13 @@ static int __init regulator_init(void)
>
>   #ifdef CONFIG_DEBUG_FS
>   	debugfs_root = debugfs_create_dir("regulator", NULL);
> -	if (IS_ERR(debugfs_root) || !debugfs_root) {
> +	if (IS_ERR_OR_NULL(debugfs_root)) {
>   		pr_warn("regulator: Failed to create debugfs directory\n");
>   		debugfs_root = NULL;
>   	}
>
> -	if (IS_ERR(debugfs_create_file("supply_map", 0444, debugfs_root,
> -				       NULL,&supply_map_fops)))
> -		pr_warn("regulator: Failed to create supplies debugfs\n");
> +	debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
> +			&supply_map_fops);

Do you want an else here so that if the regulator directory fails we 
don't accidentally create a supply_map file in the root of debugfs? How 
ever unlikely that sounds.
--
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