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]
Date:   Mon, 18 Jun 2018 21:45:53 +0800
From:   Coly Li <colyli@...e.de>
To:     Florian Schmaus <flo@...kplace.eu>,
        Kent Overstreet <kent.overstreet@...il.com>,
        linux-bcache@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] bcache: do not assign in if condition in
 bcache_device_init()

On 2018/6/18 6:09 PM, Florian Schmaus wrote:
> Fixes an error condition reported by checkpatch.pl which is caused by
> assigning a variable in an if condition.
> 
> Signed-off-by: Florian Schmaus <flo@...kplace.eu>
> ---
>  drivers/md/bcache/super.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index f09f4f046315..4a2a028c8754 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -796,11 +796,12 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  		return idx;
>  
>  	if (bioset_init(&d->bio_split, 4, offsetof(struct bbio, bio),
> -			BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER) ||
> -	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
> -		ida_simple_remove(&bcache_device_idx, idx);
> -		return -ENOMEM;
> -	}
> +				BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER))

Signed-off-by: Coly Li <colyli@...e.de>
I fix the above indent and added the patch into for-next patch set. Thanks.

Coly Li

> +		goto err;
> +
> +	d->disk = alloc_disk(BCACHE_MINORS);
> +	if (!d->disk)
> +		goto err;
>  
>  	set_capacity(d->disk, sectors);
>  	snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", idx);
> @@ -834,6 +835,11 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  	blk_queue_write_cache(q, true, true);
>  
>  	return 0;
> +
> +err:
> +	ida_simple_remove(&bcache_device_idx, idx);
> +	return -ENOMEM;
> +
>  }
>  
>  /* Cached device */
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ