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:   Fri, 13 Oct 2017 19:29:41 +0300
From:   Leonard Crestez <leonard.crestez@....com>
To:     Pierre-Hugues Husson <phh@....me>, Mark Brown <broonie@...nel.org>,
        "Lee Jones" <lee.jones@...aro.org>
CC:     Liam Girdwood <lgirdwood@...il.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] regulator: rn5t618: add RC5T619 PMIC support

On Sun, 2017-08-27 at 15:58 +0200, Pierre-Hugues Husson wrote:
> Extend the driver to support Ricoh RC5T619.
> Support the additional regulators and slightly different voltage ranges.
> 
> @@ -101,10 +131,7 @@ static int rn5t618_regulator_probe(struct platform_device *pdev)
>  	config.dev = pdev->dev.parent;
>  	config.regmap = rn5t618->regmap;
>  
> -	for (i = 0; i < RN5T618_REG_NUM; i++) {
> -		if (!regulators[i].name)
> -			continue;
> -
> +	for (i = 0; i < num_regulators; i++) {
>  		rdev = devm_regulator_register(&pdev->dev,
>  					       ®ulators[i],
>  					       &config);

This is wrong. The rn5t*_regulators arrays are indexed by RN5T618_*
constants and can have gaps. If you remove the check for
regulators[i].name then older models get errors like this:
	
rn5t618-regulator rn5t618-regulator: failed to register (null) regulator
rn5t618-regulator: probe of rn5t618-regulator failed with error -22

Either the check needs to be kep or otherwise regulator_desc arrays
should be modified. Indexing by RN5T618_* does not appear to be used so
maybe just use a flat array? That would also save a few bytes of
memory.

I know it's a late comment and the patch was already accepted, I just
noticed that rn5t567 fails to probe while working on something else.

--
Regards,
Leonard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ