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]
Message-ID: <20130204194125.GW4720@opensource.wolfsonmicro.com>
Date:	Mon, 4 Feb 2013 19:41:26 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/73] regulator: core: Show consumers that hold a
 regulator in Sysfs

On Mon, Feb 04, 2013 at 11:53:27AM +0000, Lee Jones wrote:

> +	int use;

Better to call it use_count like the other use_count.

> +	list_for_each_entry(reg, &rdev->consumer_list, list) {
> +		if (!reg->use)
> +			continue;
> +
> +		if (reg->dev != NULL)
> +			size += sprintf((buf + size), "%s (%d) ",
> +					dev_name(reg->dev), reg->use);
> +		else
> +			size += sprintf((buf + size), "unknown (%d) ",
> +					reg->use);

Should really check we don't go over PAGE_SIZE, and since this isn't a
simple value it should go in debugfs (a simple count would be OK in
sysfs, I'd suggest adding both).

>  	if (ret != 0 && rdev->supply)
>  		regulator_disable(rdev->supply);
> +	else
> +		regulator->use++;

This will increase the usage count in the case where we get an error but
don't have a parent supply.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ