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:   Thu, 22 Jun 2017 23:07:34 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc:     Tony Luck <tony.luck@...el.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
        Qiuxu Zhuo <qiuxu.zhuo@...el.com>
Subject: Re: [PATCH 2/2] edac: pnd2_edac: remove useless variable assignment

On Thu, Jun 22, 2017 at 02:30:10PM -0500, Gustavo A. R. Silva wrote:
> Value assigned to variable _ret_ at line 176 is overwritten
> a few lines below before it can be used. This makes such
> variable assignment useless.
> 
> Addresses-Coverity-ID: 1403730

Get rid of this tag...

> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
> ---
>  drivers/edac/pnd2_edac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
> index c51ec73..d1de53e 100644
> --- a/drivers/edac/pnd2_edac.c
> +++ b/drivers/edac/pnd2_edac.c
> @@ -173,7 +173,7 @@ static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *na
>  	edac_dbg(2, "Read %s port=%x off=%x op=%x\n", name, port, off, op);
>  	switch (sz) {
>  	case 8:
> -		ret = sbi_send(port, off + 4, op, (u32 *)(data + 4));
> +		sbi_send(port, off + 4, op, (u32 *)(data + 4));

... keep ret but OR it in with its previous value:

        case 8:
                ret  = sbi_send(port, off + 4, op, (u32 *)(data + 4));
		/* fall through */
        case 4:
                ret |= sbi_send(port, off, op, (u32 *)data);

>  		/* fall through */
>  	case 4:
>  		ret = sbi_send(port, off, op, (u32 *)data);

... and merge both into a single patch.

Thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ