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:   Mon, 11 Nov 2019 13:25:57 +0100
From:   Jürgen Groß <jgross@...e.com>
To:     Colin King <colin.king@...onical.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Stefano Stabellini <sstabellini@...nel.org>,
        xen-devel@...ts.xenproject.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] xen/gntdev: remove redundant non-zero check on ret

On 11.11.19 13:20, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The non-zero check on ret is always going to be false because
> ret was initialized as zero and the only place it is set to
> non-zero contains a return path before the non-zero check. Hence
> the check is redundant and can be removed.

Which version did you patch against? In current master the above
statement is not true.


Juergen

> 
> Addresses-Coverity: ("Logically dead code")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   drivers/xen/gntdev.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
> index 10cc5e9e612a..07d80b176118 100644
> --- a/drivers/xen/gntdev.c
> +++ b/drivers/xen/gntdev.c
> @@ -524,11 +524,6 @@ static int gntdev_open(struct inode *inode, struct file *flip)
>   	}
>   #endif
>   
> -	if (ret) {
> -		kfree(priv);
> -		return ret;
> -	}
> -
>   	flip->private_data = priv;
>   #ifdef CONFIG_XEN_GRANT_DMA_ALLOC
>   	priv->dma_dev = gntdev_miscdev.this_device;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ