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:   Tue, 13 Jun 2017 19:31:21 +0530
From:   Keerthy <j-keerthy@...com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        <linux-kernel@...r.kernel.org>
CC:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Tony Lindgren <tony@...mide.com>, <linux-omap@...r.kernel.org>
Subject: Re: [PATCH 1/2] regulator: tps65910: check TPS65910_NUM_REGS at build
 time



On Tuesday 13 June 2017 07:28 PM, Michał Mirosław wrote:

Missing commit log?

> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> ---
>  drivers/regulator/tps65910-regulator.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
> index 696116ebdf50a..81672a58fcc23 100644
> --- a/drivers/regulator/tps65910-regulator.c
> +++ b/drivers/regulator/tps65910-regulator.c
> @@ -1107,6 +1107,7 @@ static int tps65910_probe(struct platform_device *pdev)
>  
>  	switch (tps65910_chip_id(tps65910)) {
>  	case TPS65910:
> +		BUILD_BUG_ON(TPS65910_NUM_REGS < ARRAY_SIZE(tps65910_regs));
>  		pmic->get_ctrl_reg = &tps65910_get_ctrl_register;
>  		pmic->num_regulators = ARRAY_SIZE(tps65910_regs);
>  		pmic->ext_sleep_control = tps65910_ext_sleep_control;
> @@ -1119,6 +1120,7 @@ static int tps65910_probe(struct platform_device *pdev)
>  					DCDCCTRL_DCDCCKSYNC_MASK);
>  		break;
>  	case TPS65911:
> +		BUILD_BUG_ON(TPS65910_NUM_REGS < ARRAY_SIZE(tps65911_regs));
>  		pmic->get_ctrl_reg = &tps65911_get_ctrl_register;
>  		pmic->num_regulators = ARRAY_SIZE(tps65911_regs);
>  		pmic->ext_sleep_control = tps65911_ext_sleep_control;
> @@ -1144,8 +1146,7 @@ static int tps65910_probe(struct platform_device *pdev)
>  	if (!pmic->rdev)
>  		return -ENOMEM;
>  
> -	for (i = 0; i < pmic->num_regulators && i < TPS65910_NUM_REGS;
> -			i++, info++) {
> +	for (i = 0; i < pmic->num_regulators; i++, info++) {
>  		/* Register the regulators */
>  		pmic->info[i] = info;
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ