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  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]
Date:   Tue, 5 Nov 2019 10:41:54 +0100
From:   Jan Kara <jack@...e.cz>
To:     Chengguang Xu <cgxu519@...ernel.net>
Cc:     jack@...e.com, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext2: check err when partial != NULL

On Tue 05-11-19 12:51:00, Chengguang Xu wrote:
> Check err when partial == NULL is meaningless because
> partial == NULL means getting branch successfully without
> error.
> 
> Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>

Good catch! Added to my tree. Thanks!

							Honza

> ---
>  fs/ext2/inode.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index 7004ce581a32..a16c53655e77 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -701,10 +701,13 @@ static int ext2_get_blocks(struct inode *inode,
>  		if (!partial) {
>  			count++;
>  			mutex_unlock(&ei->truncate_mutex);
> -			if (err)
> -				goto cleanup;
>  			goto got_it;
>  		}
> +
> +		if (err) {
> +			mutex_unlock(&ei->truncate_mutex);
> +			goto cleanup;
> +		}
>  	}
>  
>  	/*
> -- 
> 2.20.1
> 
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists