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]
Message-ID: <20161019033803.i4z65zpttyz2asft@earth>
Date:   Wed, 19 Oct 2016 05:38:03 +0200
From:   Sebastian Reichel <sre@...nel.org>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Milo Kim <milo.kim@...com>, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] power: supply: lp8788: remove an unneeded NULL check

Hi Dan,

On Fri, Oct 14, 2016 at 10:33:28AM +0300, Dan Carpenter wrote:
> We checked that "pdata->chg_params" is non-NULL earlier in this function
> so when we add "i" to it, it's still non-NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> 
> diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
> index 7321b72..509e2b3 100644
> --- a/drivers/power/supply/lp8788-charger.c
> +++ b/drivers/power/supply/lp8788-charger.c
> @@ -384,9 +384,6 @@ static int lp8788_update_charger_params(struct platform_device *pdev,
>  	for (i = 0; i < pdata->num_chg_params; i++) {
>  		param = pdata->chg_params + i;
>  
> -		if (!param)
> -			continue;
> -
>  		if (lp8788_is_valid_charger_register(param->addr)) {
>  			ret = lp8788_write_byte(lp, param->addr, param->val);
>  			if (ret)

Thanks, queued.

-- Sebastian

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ