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: <8f48a898-55e3-b539-9c4c-19714d827b2c@oracle.com>
Date:   Fri, 8 Oct 2021 08:35:06 +0800
From:   Anand Jain <anand.jain@...cle.com>
To:     Colin King <colin.king@...onical.com>, Chris Mason <clm@...com>,
        Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: Remove redundant assignment of variable ret

On 08/10/2021 07:27, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The variable ret is being assigned a value that is never read, it is
> updated later on with a different value. The assignment is redundant and
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   fs/btrfs/free-space-cache.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index 8ea04582e34b..2a6d02971357 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -735,8 +735,6 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
>   		return 0;
>   	}
>   
> -	ret = -1;
> -

Essentially we had goto out; when the inode generation check failed few
lines below.  However, the commit a67509c30079 (Btrfs: add an io_ctl
struct and helpers for dealing with the space cache) replaced it with
return 0; and then ret = -1 did not make any sense.

Reviewed-by: Anand Jain <anand.jain@...cle.com>

Thanks, Anand

>   	leaf = path->nodes[0];
>   	header = btrfs_item_ptr(leaf, path->slots[0],
>   				struct btrfs_free_space_header);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ